From 0817432b6ca71ce66cd9ace06afd2639a54219cb Mon Sep 17 00:00:00 2001 From: Travers Franckle Date: Thu, 1 Nov 2012 13:11:25 -0400 Subject: [PATCH] inital changes for SMART v0.5 - Update CodedValue - Move Procedure to SMART data model, fixes #24 - Update LabResult, fixes #28 - Update Vital Signs, fixes #29 - Update Allergy, fixes #30 - --- indivo/data_models/core/allergy/example.py | 29 +- indivo/data_models/core/allergy/example.sdmj | 29 +- indivo/data_models/core/allergy/example.sdmx | 33 +- indivo/data_models/core/allergy/extra.py | 30 +- indivo/data_models/core/allergy/model.py | 2 +- .../data_models/core/equipment/example.sdmx | 2 +- .../data_models/core/immunization/example.py | 24 +- .../core/immunization/example.sdmj | 24 +- .../core/immunization/example.sdmx | 26 +- indivo/data_models/core/immunization/extra.py | 20 +- indivo/data_models/core/lab/example.py | 36 +- indivo/data_models/core/lab/example.sdmj | 30 +- indivo/data_models/core/lab/example.sdmx | 36 +- indivo/data_models/core/lab/extra.py | 14 +- indivo/data_models/core/lab/model.py | 11 +- indivo/data_models/core/lab/model.sdml | 10 +- indivo/data_models/core/medication/example.py | 12 +- .../data_models/core/medication/example.sdmj | 12 +- .../data_models/core/medication/example.sdmx | 14 +- indivo/data_models/core/medication/extra.py | 10 +- indivo/data_models/core/medication/model.py | 2 +- indivo/data_models/core/problem/example.py | 6 +- indivo/data_models/core/problem/example.sdmj | 6 +- indivo/data_models/core/problem/example.sdmx | 8 +- indivo/data_models/core/problem/extra.py | 6 +- indivo/data_models/core/procedure/example.py | 28 +- .../data_models/core/procedure/example.sdmj | 27 +- .../data_models/core/procedure/example.sdmx | 33 +- indivo/data_models/core/procedure/extra.py | 25 + indivo/data_models/core/procedure/model.py | 21 +- indivo/data_models/core/procedure/model.sdml | 2 +- .../core/simple_clinical_note/example.sdmx | 2 +- indivo/data_models/core/vitals/example.py | 85 +- indivo/data_models/core/vitals/example.sdmj | 78 +- indivo/data_models/core/vitals/example.sdmx | 85 +- indivo/data_models/core/vitals/extra.py | 58 +- indivo/data_models/core/vitals/model.py | 11 +- indivo/data_models/core/vitals/model.sdml | 2 +- indivo/fields/dummy_fields.py | 146 +- indivo/lib/rdf.py | 374 +-- indivo/migrations/0037_smart_05_changes.py | 2274 +++++++++++++++++ indivo/models/base.py | 4 +- .../schemas/data/core/procedure/procedure.xml | 8 - indivo/schemas/data/core/procedure/schema.xsd | 19 - .../schemas/data/core/procedure/transform.xsl | 28 - indivo/tests/api/carenets_tests.py | 2 +- indivo/tests/api/records_tests.py | 2 +- indivo/tests/api/reporting_tests.py | 29 +- indivo/tests/data/reports/allergy.py | 52 +- indivo/tests/data/reports/immunization.py | 24 +- indivo/tests/data/reports/lab.py | 36 +- indivo/tests/data/reports/procedure.py | 58 +- indivo/tests/data/reports/vital.py | 184 +- indivo/tests/integration/pluggable_schemas.py | 2 +- .../test_modules/document_processing.py | 2 +- .../integration/test_modules/security.py | 2 +- .../schemas/core/procedure/procedure.xml | 8 - .../tests/schemas/core/procedure/schema.xsd | 19 - .../schemas/core/procedure/transform.xsl | 28 - indivo/tests/unit/lib/schema_loader.py | 1 - indivo/tests/unit/lib/simpledatamodel.py | 10 +- indivo/tests/unit/models/document.py | 2 +- indivo/tests/unit/models/fact.py | 12 +- indivo/urls/carenet.py | 2 - indivo/urls/record_reports.py | 2 - indivo/views/pha.py | 4 +- indivo/views/reports/smart.py | 3 +- indivo/views/smart_container.py | 2 +- 68 files changed, 3266 insertions(+), 962 deletions(-) create mode 100644 indivo/data_models/core/procedure/extra.py create mode 100644 indivo/migrations/0037_smart_05_changes.py delete mode 100644 indivo/schemas/data/core/procedure/procedure.xml delete mode 100644 indivo/schemas/data/core/procedure/schema.xsd delete mode 100644 indivo/schemas/data/core/procedure/transform.xsl delete mode 100644 indivo/tests/schemas/core/procedure/procedure.xml delete mode 100644 indivo/tests/schemas/core/procedure/schema.xsd delete mode 100644 indivo/tests/schemas/core/procedure/transform.xsl diff --git a/indivo/data_models/core/allergy/example.py b/indivo/data_models/core/allergy/example.py index 3571a993..e5803bb9 100644 --- a/indivo/data_models/core/allergy/example.py +++ b/indivo/data_models/core/allergy/example.py @@ -1,22 +1,23 @@ from indivo.models import Allergy allergy_fact = Allergy( - allergic_reaction_title="Anaphylaxis", - allergic_reaction_system="http://purl.bioontology.org/ontology/SNOMEDCT/", - allergic_reaction_identifier="39579001", - category_title="Drug allergy", - category_system="http://purl.bioontology.org/ontology/SNOMEDCT/", - category_identifier="416098002", - drug_class_allergen_title="Sulfonamide Antibacterial", - drug_class_allergen_system="http://purl.bioontology.org/ontology/NDFRT/", - drug_class_allergen_identifier="N0000175503", - severity_title="Severe", - severity_system="http://purl.bioontology.org/ontology/SNOMEDCT/", - severity_identifier="24484000", + allergic_reaction_code_title="Anaphylaxis", + allergic_reaction_code_system="http://purl.bioontology.org/ontology/SNOMEDCT/", + allergic_reaction_code_identifier="39579001", + category_code_title="Drug allergy", + category_code_system="http://purl.bioontology.org/ontology/SNOMEDCT/", + category_code_identifier="416098002", + drug_class_allergen_code_title="Sulfonamide Antibacterial", + drug_class_allergen_code_system="http://purl.bioontology.org/ontology/NDFRT/", + drug_class_allergen_code_identifier="N0000175503", + severity_code_title="Severe", + severity_code_system="http://purl.bioontology.org/ontology/SNOMEDCT/", + severity_code_identifier="24484000", ) allergy_exclusion = AllergyExclusion( name_title="No known allergies", - name_identifier="160244002", - name_system="http://purl.bioontology.org/ontology/SNOMEDCT/", + name_code_title="No known allergies", + name_code_identifier="160244002", + name_code_system="http://purl.bioontology.org/ontology/SNOMEDCT/", ) diff --git a/indivo/data_models/core/allergy/example.sdmj b/indivo/data_models/core/allergy/example.sdmj index 0f885d3b..3443af26 100644 --- a/indivo/data_models/core/allergy/example.sdmj +++ b/indivo/data_models/core/allergy/example.sdmj @@ -1,21 +1,22 @@ [{ "__modelname__": "Allergy", - "allergic_reaction_title": "Anaphylaxis", - "allergic_reaction_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", - "allergic_reaction_identifier": "39579001", - "category_title": "Drug allergy", - "category_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", - "category_identifier": "416098002", - "drug_class_allergen_title": "Sulfonamide Antibacterial", - "drug_class_allergen_system": "http://purl.bioontology.org/ontology/NDFRT/", - "drug_class_allergen_identifier": "N0000175503", - "severity_title": "Severe", - "severity_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", - "severity_identifier": "24484000" + "allergic_reaction_code_title": "Anaphylaxis", + "allergic_reaction_code_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", + "allergic_reaction_code_identifier": "39579001", + "category_code_title": "Drug allergy", + "category_code_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", + "category_code_identifier": "416098002", + "drug_class_allergen_code_title": "Sulfonamide Antibacterial", + "drug_class_allergen_code_system": "http://purl.bioontology.org/ontology/NDFRT/", + "drug_class_allergen_code_identifier": "N0000175503", + "severity_code_title": "Severe", + "severity_code_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", + "severity_code_identifier": "24484000" }, { "__modelname__": "AllergyExclusion", "name_title": "No known allergies", - "name_identifier":"160244002", - "name_system": "http://purl.bioontology.org/ontology/SNOMEDCT" + "name_code_title": "No known allergies", + "name_code_identifier":"160244002", + "name_code_system": "http://purl.bioontology.org/ontology/SNOMEDCT" }] \ No newline at end of file diff --git a/indivo/data_models/core/allergy/example.sdmx b/indivo/data_models/core/allergy/example.sdmx index 9d825746..78a3de3d 100644 --- a/indivo/data_models/core/allergy/example.sdmx +++ b/indivo/data_models/core/allergy/example.sdmx @@ -1,21 +1,22 @@ - + - Anaphylaxis - http://purl.bioontology.org/ontology/SNOMEDCT/ - 39579001 - Drug allergy - http://purl.bioontology.org/ontology/SNOMEDCT/ - 416098002 - Sulfonamide Antibacterial - http://purl.bioontology.org/ontology/NDFRT/ - N0000175503 - Severe - http://purl.bioontology.org/ontology/SNOMEDCT/ - 24484000 + Anaphylaxis + http://purl.bioontology.org/ontology/SNOMEDCT/ + 39579001 + Drug allergy + http://purl.bioontology.org/ontology/SNOMEDCT/ + 416098002 + Sulfonamide Antibacterial + http://purl.bioontology.org/ontology/NDFRT/ + N0000175503 + Severe + http://purl.bioontology.org/ontology/SNOMEDCT/ + 24484000 - No known allergies - 160244002 - http://purl.bioontology.org/ontology/SNOMEDCT/ + No known allergies + No known allergies + 160244002 + http://purl.bioontology.org/ontology/SNOMEDCT/ \ No newline at end of file diff --git a/indivo/data_models/core/allergy/extra.py b/indivo/data_models/core/allergy/extra.py index d2f27526..9f4dda76 100644 --- a/indivo/data_models/core/allergy/extra.py +++ b/indivo/data_models/core/allergy/extra.py @@ -44,18 +44,18 @@ class AllergyOptions(DataModelOptions): model_class_name = 'Allergy' serializers = AllergySerializers 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()], + 'allergic_reaction_code_system': [ExactValueValidator(SNOMED)], + 'allergic_reaction_code_identifier': [NonNullValidator()], + 'allergic_reaction_code_title': [NonNullValidator()], + 'category_code_system': [ExactValueValidator(SNOMED)], + 'category_code_identifier': [ValueInSetValidator(VALID_CATEGORY_IDS)], + 'category_code_title': [NonNullValidator()], + 'drug_allergen_code_system': [ExactValueValidator(RXNORM, nullable=True)], + 'drug_class_allergen_code_system': [ExactValueValidator(NUI, nullable=True)], + 'other_allergen_code_system': [ExactValueValidator(UNII, nullable=True)], + 'severity_code_system': [ExactValueValidator(SNOMED)], + 'severity_code_identifier': [ValueInSetValidator(VALID_SEVERITY_IDS)], + 'severity_code_title': [NonNullValidator()], } class AllergyExclusionSerializers(DataModelSerializers): @@ -71,7 +71,7 @@ class AllergyExclusionOptions(DataModelOptions): model_class_name = 'AllergyExclusion' serializers = AllergyExclusionSerializers field_validators = { - 'name_system': [ExactValueValidator(SNOMED)], - 'name_identifier': [ValueInSetValidator(VALID_EXCLUSION_IDS)], - 'name_title': [NonNullValidator()], + 'name_code_system': [ExactValueValidator(SNOMED)], + 'name_code_identifier': [ValueInSetValidator(VALID_EXCLUSION_IDS)], + 'name_code_title': [NonNullValidator()], } diff --git a/indivo/data_models/core/allergy/model.py b/indivo/data_models/core/allergy/model.py index 09da61fe..290b9df1 100644 --- a/indivo/data_models/core/allergy/model.py +++ b/indivo/data_models/core/allergy/model.py @@ -6,7 +6,7 @@ class Allergy(Fact): category = CodedValueField() drug_allergen = CodedValueField() drug_class_allergen = CodedValueField() - food_allergen = CodedValueField() + other_allergen = CodedValueField() severity = CodedValueField() class AllergyExclusion(Fact): diff --git a/indivo/data_models/core/equipment/example.sdmx b/indivo/data_models/core/equipment/example.sdmx index 6b21491d..f598862e 100644 --- a/indivo/data_models/core/equipment/example.sdmx +++ b/indivo/data_models/core/equipment/example.sdmx @@ -1,4 +1,4 @@ - + 2009-02-05 2009-06-12 diff --git a/indivo/data_models/core/immunization/example.py b/indivo/data_models/core/immunization/example.py index 2477a93e..65eebeaf 100644 --- a/indivo/data_models/core/immunization/example.py +++ b/indivo/data_models/core/immunization/example.py @@ -3,17 +3,17 @@ immunization_fact = Immunization( date=date("2009-05-16T12:00:00Z"), - administration_status_title="Not Administered", - administration_status_system="http://smartplatforms.org/terms/codes/ImmunizationAdministrationStatus#", - administration_status_identifier="notAdministered", - product_class_title="TYPHOID", - product_class_system="http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=vg#", - product_class_identifier="TYPHOID", - product_name_title="typhoid, oral", - product_name_system="http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=cvx#", - product_name_identifier="25", - refusal_reason_title="Allergy to vaccine/vaccine components, or allergy to eggs", - refusal_reason_system="http://smartplatforms.org/terms/codes/ImmunizationRefusalReason#", - refusal_reason_identifier="allergy", + administration_status_code_title="Not Administered", + administration_status_code_system="http://smartplatforms.org/terms/codes/ImmunizationAdministrationStatus#", + administration_status_code_identifier="notAdministered", + product_class_code_title="TYPHOID", + product_class_code_system="http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=vg#", + product_class_code_identifier="TYPHOID", + product_name_code_title="typhoid, oral", + product_name_code_system="http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=cvx#", + product_name_code_identifier="25", + refusal_reason_code_title="Allergy to vaccine/vaccine components, or allergy to eggs", + refusal_reason_code_system="http://smartplatforms.org/terms/codes/ImmunizationRefusalReason#", + refusal_reason_code_identifier="allergy", ) diff --git a/indivo/data_models/core/immunization/example.sdmj b/indivo/data_models/core/immunization/example.sdmj index da214409..4b432408 100644 --- a/indivo/data_models/core/immunization/example.sdmj +++ b/indivo/data_models/core/immunization/example.sdmj @@ -1,17 +1,17 @@ { "__modelname__": "Immunization", "date": "2009-05-16T12:00:00Z", - "administration_status_title": "Not Administered", - "administration_status_system": "http://smartplatforms.org/terms/codes/ImmunizationAdministrationStatus#", - "administration_status_identifier": "notAdministered", - "product_class_title": "TYPHOID", - "product_class_system": "http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=vg#", - "product_class_identifier": "TYPHOID", - "product_name_title": "typhoid, oral", - "product_name_system": "http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=cvx#", - "product_name_identifier": "25", - "refusal_reason_title": "Allergy to vaccine/vaccine components, or allergy to eggs", - "refusal_reason_system": "http://smartplatforms.org/terms/codes/ImmunizationRefusalReason#", - "refusal_reason_identifier": "allergy" + "administration_status_code_title": "Not Administered", + "administration_status_code_system": "http://smartplatforms.org/terms/codes/ImmunizationAdministrationStatus#", + "administration_status_code_identifier": "notAdministered", + "product_class_code_title": "TYPHOID", + "product_class_code_system": "http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=vg#", + "product_class_code_identifier": "TYPHOID", + "product_name_code_title": "typhoid, oral", + "product_name_code_system": "http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=cvx#", + "product_name_code_identifier": "25", + "refusal_reason_code_title": "Allergy to vaccine/vaccine components, or allergy to eggs", + "refusal_reason_code_system": "http://smartplatforms.org/terms/codes/ImmunizationRefusalReason#", + "refusal_reason_code_identifier": "allergy" } diff --git a/indivo/data_models/core/immunization/example.sdmx b/indivo/data_models/core/immunization/example.sdmx index 2716e7f9..eabb062a 100644 --- a/indivo/data_models/core/immunization/example.sdmx +++ b/indivo/data_models/core/immunization/example.sdmx @@ -1,18 +1,18 @@ - + 2009-05-16T12:00:00Z - Not Administered - http://smartplatforms.org/terms/codes/ImmunizationAdministrationStatus# - notAdministered - TYPHOID - http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=vg# - TYPHOID - typhoid, oral - http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=cvx# - 25 - Allergy to vaccine/vaccine components, or allergy to eggs - http://smartplatforms.org/terms/codes/ImmunizationRefusalReason# - allergy + Not Administered + http://smartplatforms.org/terms/codes/ImmunizationAdministrationStatus# + notAdministered + TYPHOID + http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=vg# + TYPHOID + typhoid, oral + http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=cvx# + 25 + Allergy to vaccine/vaccine components, or allergy to eggs + http://smartplatforms.org/terms/codes/ImmunizationRefusalReason# + allergy diff --git a/indivo/data_models/core/immunization/extra.py b/indivo/data_models/core/immunization/extra.py index 6d05862f..3a4fd303 100644 --- a/indivo/data_models/core/immunization/extra.py +++ b/indivo/data_models/core/immunization/extra.py @@ -44,14 +44,14 @@ class ImmunizationOptions(DataModelOptions): 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)], + 'administration_status_code_system': [ExactValueValidator(IMM_STATUS_URI)], + 'administration_status_code_identifier': [ValueInSetValidator(VALID_IMM_STATUSES)], + 'administration_status_code_title': [NonNullValidator()], + 'product_class_code_system': [ExactValueValidator(IMM_CLASS_URI, nullable=True)], + 'product_class_2_code_system': [ExactValueValidator(IMM_CLASS_URI, nullable=True)], + 'product_name_code_system': [ExactValueValidator(IMM_PROD_URI)], + 'product_name_code_identifier': [NonNullValidator()], + 'product_name_code_title': [NonNullValidator()], + 'refusal_reason_code_system': [ExactValueValidator(IMM_REFUSE_URI, nullable=True)], + 'refusal_reason_code_identifier': [ValueInSetValidator(VALID_REFUSALS, nullable=True)], } diff --git a/indivo/data_models/core/lab/example.py b/indivo/data_models/core/lab/example.py index 7b6757e2..6e4adb08 100644 --- a/indivo/data_models/core/lab/example.py +++ b/indivo/data_models/core/lab/example.py @@ -2,19 +2,21 @@ from indivo.lib.iso8601 import parse_utc_date as date lab_fact = LabResult( - abnormal_interpretation_title="Normal", - abnormal_interpretation_system="http://smartplatforms.org/terms/codes/LabResultInterpretation#", - abnormal_interpretation_identifier="normal", + date=date("2009-05-16T12:00:00Z"), + + abnormal_interpretation_code_title="Normal", + abnormal_interpretation_code_system="http://smartplatforms.org/terms/codes/LabResultInterpretation#", + abnormal_interpretation_code_identifier="normal", accession_number="AC09205823577", - test_name_title="Serum Sodium", - test_name_system="http://purl.bioontology.org/ontology/LNC/", - test_name_identifier="2951-2", + name_code_title="Serum Sodium", + name_code_system="http://purl.bioontology.org/ontology/LNC/", + name_code_identifier="2951-2", - status_title="Final results: complete and verified", - status_system="http://smartplatforms.org/terms/codes/LabStatus#", - status_identifier="final", + status_code_title="Final results: complete and verified", + status_code_system="http://smartplatforms.org/terms/codes/LabStatus#", + status_code_identifier="final", notes="Blood sample appears to have hemolyzed", @@ -29,20 +31,6 @@ quantitative_result_normal_range_min_unit="mEq/L", quantitative_result_value_value="140", - quantitative_result_value_unit="mEq/L", - - collected_at=date("2010-12-27T17:00:00Z"), - - collected_by_org_name="City Lab", - collected_by_org_adr_country="USA", - collected_by_org_adr_city="Springfield", - collected_by_org_adr_postalcode="11111", - collected_by_org_adr_region="MA", - collected_by_org_adr_street="20 Elm St", - - collected_by_name_family="Finnialispi", - collected_by_name_given="Tad", - - collected_by_role="Lab Specialist", + quantitative_result_value_unit="mEq/L" ) diff --git a/indivo/data_models/core/lab/example.sdmj b/indivo/data_models/core/lab/example.sdmj index 102acfb8..610e8788 100644 --- a/indivo/data_models/core/lab/example.sdmj +++ b/indivo/data_models/core/lab/example.sdmj @@ -1,18 +1,20 @@ { "__modelname__": "LabResult", + "date": "2009-05-16T12:00:00Z", + "abnormal_interpretation_title": "Normal", "abnormal_interpretation_system": "http"://smartplatforms.org/terms/codes/LabResultInterpretation#", "abnormal_interpretation_identifier": "normal", "accession_number": "AC09205823577", - "test_name_title": "Serum Sodium", - "test_name_system": "http"://purl.bioontology.org/ontology/LNC/", - "test_name_identifier": "2951-2", + "name_code_title": "Serum Sodium", + "name_code_system": "http"://purl.bioontology.org/ontology/LNC/", + "name_code_identifier": "2951-2", - "status_title": "Final results": complete and verified", - "status_system": "http"://smartplatforms.org/terms/codes/LabStatus#", - "status_identifier": "final", + "status_code_title": "Final results": complete and verified", + "status_code_system": "http"://smartplatforms.org/terms/codes/LabStatus#", + "status_code_identifier": "final", "notes": "Blood sample appears to have hemolyzed", @@ -27,20 +29,6 @@ "quantitative_result_normal_range_min_unit": "mEq/L", "quantitative_result_value_value": "140", - "quantitative_result_value_unit": "mEq/L", - - "collected_at": "2010-12-27T17":00":00Z", - - "collected_by_org_name": "City Lab", - "collected_by_org_adr_country": "USA", - "collected_by_org_adr_city": "Springfield", - "collected_by_org_adr_postalcode": "11111", - "collected_by_org_adr_region": "MA", - "collected_by_org_adr_street": "20 Elm St", - - "collected_by_name_family": "Finnialispi", - "collected_by_name_given": "Tad", - - "collected_by_role": "Lab Specialist" + "quantitative_result_value_unit": "mEq/L" } diff --git a/indivo/data_models/core/lab/example.sdmx b/indivo/data_models/core/lab/example.sdmx index 7f608800..608374b5 100644 --- a/indivo/data_models/core/lab/example.sdmx +++ b/indivo/data_models/core/lab/example.sdmx @@ -1,18 +1,20 @@ - + - Normal - http://smartplatforms.org/terms/codes/LabResultInterpretation# - normal + 2009-05-16T12:00:00Z + + Normal + http://smartplatforms.org/terms/codes/LabResultInterpretation# + normal AC09205823577 - Serum Sodium - http://purl.bioontology.org/ontology/LNC/ - 2951-2 + Serum Sodium + http://purl.bioontology.org/ontology/LNC/ + 2951-2 - Final results: complete and verified - http://smartplatforms.org/terms/codes/LabStatus# - final + Final results: complete and verified + http://smartplatforms.org/terms/codes/LabStatus# + final Blood sample appears to have hemolyzed @@ -28,20 +30,6 @@ 140 mEq/L - - 2010-12-27T17:00:00Z - - City Lab - USA - Springfield - 11111 - MA - 20 Elm St - - Finnialispi - Tad - - Lab Specialist diff --git a/indivo/data_models/core/lab/extra.py b/indivo/data_models/core/lab/extra.py index 42a0a000..d35d91fc 100644 --- a/indivo/data_models/core/lab/extra.py +++ b/indivo/data_models/core/lab/extra.py @@ -32,11 +32,11 @@ 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)], + 'abnormal_interpretation_code_system': [ExactValueValidator(LAB_INTERP_URI, nullable=True)], + 'abnormal_interpretation_code_identifier': [ValueInSetValidator(VALID_INTERPS, nullable=True)], + 'name_code_system': [ExactValueValidator(LOINC_URI)], + 'name_code_identifier': [NonNullValidator()], + 'name_code_title': [NonNullValidator()], + 'status_code_system': [ExactValueValidator(LAB_STATUS_URI, nullable=True)], + 'status_code_identifier': [ValueInSetValidator(VALID_STATUSES, nullable=True)], } diff --git a/indivo/data_models/core/lab/model.py b/indivo/data_models/core/lab/model.py index c52841df..6118ef9e 100644 --- a/indivo/data_models/core/lab/model.py +++ b/indivo/data_models/core/lab/model.py @@ -1,16 +1,13 @@ from indivo.models import Fact from django.db import models -from indivo.fields import CodedValueField, QuantitativeResultField, OrganizationField, NameField +from indivo.fields import CodedValueField, QuantitativeResultField class LabResult(Fact): + date = models.DateTimeField(null=True) abnormal_interpretation = CodedValueField() accession_number = models.CharField(max_length=255, null=True) - test_name = CodedValueField() + name = CodedValueField() status = CodedValueField() narrative_result = models.CharField(max_length=255, null=True) notes = models.CharField(max_length=600, null=True) - quantitative_result = QuantitativeResultField() - collected_at = models.DateTimeField(null=True) - collected_by_org = OrganizationField() - collected_by_name = NameField() - collected_by_role = models.CharField(max_length=255, null=True) + quantitative_result = QuantitativeResultField() \ No newline at end of file diff --git a/indivo/data_models/core/lab/model.sdml b/indivo/data_models/core/lab/model.sdml index 5b5e4cd5..09b72068 100644 --- a/indivo/data_models/core/lab/model.sdml +++ b/indivo/data_models/core/lab/model.sdml @@ -1,15 +1,11 @@ { "__modelname__": "LabResult", + "date": "Date" "abnormal_interpretation": "CodedValue", "accession_number": "String", - "test_name": "CodedValue", + "name": "CodedValue", "status": "CodedValue", "narrative_result": "String", "notes": "String", - "quantitative_result": "QuantitativeResult", - "collected_at": "Date", - "collected_by_org": "Organization", - "collected_by_name": "Name", - "collected_by_role": "String" + "quantitative_result": "QuantitativeResult" } - diff --git a/indivo/data_models/core/medication/example.py b/indivo/data_models/core/medication/example.py index 95e5ff50..27c5b937 100644 --- a/indivo/data_models/core/medication/example.py +++ b/indivo/data_models/core/medication/example.py @@ -2,16 +2,16 @@ from indivo.lib.iso8601 import parse_utc_date as date med = Medication( - drugName_title="AMITRIPTYLINE HCL 50 MG TAB", - drugName_system="http://purl.bioontology.org/ontology/RXNORM/", - drugName_identifier="856845", + name_code_title="AMITRIPTYLINE HCL 50 MG TAB", + name_code_system="http://purl.bioontology.org/ontology/RXNORM/", + name_code_identifier="856845", endDate=date("2007-08-14"), frequency_value="2", frequency_unit="/d", instructions="Take two tablets twice daily as needed for pain", - provenance_title="Derived by prescription", - provenance_system="http://smartplatforms.org/terms/codes/MedicationProvenance#", - provenance_identifier="prescription", + provenance_code_title="Derived by prescription", + provenance_code_system="http://smartplatforms.org/terms/codes/MedicationProvenance#", + provenance_code_identifier="prescription", quantity_value="2", quantity_unit="{tablet}", startDate=date("2007-03-14"), diff --git a/indivo/data_models/core/medication/example.sdmj b/indivo/data_models/core/medication/example.sdmj index 003daa6a..e875d9c7 100644 --- a/indivo/data_models/core/medication/example.sdmj +++ b/indivo/data_models/core/medication/example.sdmj @@ -1,15 +1,15 @@ { "__modelname__": "Medication", - "drugName_title": "AMITRIPTYLINE HCL 50 MG TAB", - "drugName_system": "http://purl.bioontology.org/ontology/RXNORM/", - "drugName_identifier": "856845", + "name_code_title": "AMITRIPTYLINE HCL 50 MG TAB", + "name_code_system": "http://purl.bioontology.org/ontology/RXNORM/", + "name_code_identifier": "856845", "endDate": "2007-08-14", "frequency_value": "2", "frequency_unit": "/d", "instructions": "Take two tablets twice daily as needed for pain", - "provenance_title": "Derived by prescription", - "provenance_system": "http://smartplatforms.org/terms/codes/MedicationProvenance#", - "provenance_identifier": "prescription", + "provenance_code_title": "Derived by prescription", + "provenance_code_system": "http://smartplatforms.org/terms/codes/MedicationProvenance#", + "provenance_code_identifier": "prescription", "quantity_value": "2", "quantity_unit": "{tablet}", "startDate": "2007-03-14", diff --git a/indivo/data_models/core/medication/example.sdmx b/indivo/data_models/core/medication/example.sdmx index c85bcaef..0ef43fc9 100644 --- a/indivo/data_models/core/medication/example.sdmx +++ b/indivo/data_models/core/medication/example.sdmx @@ -1,15 +1,15 @@ - + - AMITRIPTYLINE HCL 50 MG TAB - http://purl.bioontology.org/ontology/RXNORM/ - 856845 + AMITRIPTYLINE HCL 50 MG TAB + http://purl.bioontology.org/ontology/RXNORM/ + 856845 2007-08-14 2 /d Take two tablets twice daily as needed for pain - Derived by prescription - http://smartplatforms.org/terms/codes/MedicationProvenance# - prescription + Derived by prescription + http://smartplatforms.org/terms/codes/MedicationProvenance# + prescription 2 {tablet} 2007-03-14 diff --git a/indivo/data_models/core/medication/extra.py b/indivo/data_models/core/medication/extra.py index 7b00b6fd..af3e5e29 100644 --- a/indivo/data_models/core/medication/extra.py +++ b/indivo/data_models/core/medication/extra.py @@ -27,11 +27,11 @@ 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)], + 'name_code_system': [ExactValueValidator(RXN_URI)], + 'name_code_identifier': [NonNullValidator()], + 'name_code_title': [NonNullValidator()], + 'provenance_code_system': [ExactValueValidator(MED_PROV_URI, nullable=True)], + 'provenance_code_identifier': [ValueInSetValidator(MED_PROVS, nullable=True)], 'startDate': [NonNullValidator()], } diff --git a/indivo/data_models/core/medication/model.py b/indivo/data_models/core/medication/model.py index a2fdf6b2..0488bfe3 100644 --- a/indivo/data_models/core/medication/model.py +++ b/indivo/data_models/core/medication/model.py @@ -3,7 +3,7 @@ from indivo.fields import CodedValueField, ValueAndUnitField, PharmacyField, ProviderField class Medication(Fact): - drugName = CodedValueField() + name = CodedValueField() endDate = models.DateField(null=True) frequency = ValueAndUnitField() instructions = models.CharField(max_length=255, null=True) diff --git a/indivo/data_models/core/problem/example.py b/indivo/data_models/core/problem/example.py index 551d360b..9a4b75c9 100644 --- a/indivo/data_models/core/problem/example.py +++ b/indivo/data_models/core/problem/example.py @@ -4,7 +4,7 @@ problem_fact = Problem( startDate=date("2009-05-16T12:00:00Z"), endDate=date("2009-05-16T16:00:00Z"), - name_title="Backache (finding)", - name_system="http://purl.bioontology.org/ontology/SNOMEDCT/", - name_identifier="161891005", + name_code_title="Backache (finding)", + name_code_system="http://purl.bioontology.org/ontology/SNOMEDCT/", + name_code_identifier="161891005", ) diff --git a/indivo/data_models/core/problem/example.sdmj b/indivo/data_models/core/problem/example.sdmj index af755bb4..cc81c9d9 100644 --- a/indivo/data_models/core/problem/example.sdmj +++ b/indivo/data_models/core/problem/example.sdmj @@ -2,7 +2,7 @@ "__modelname__": "Problem", "startDate": "2009-05-16T12:00:00Z", "endDate": "2009-05-16T16:00:00Z", - "name_title": "Backache (finding)", - "name_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", - "name_identifier": "161891005" + "name_code_title": "Backache (finding)", + "name_code_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", + "name_code_identifier": "161891005" } \ No newline at end of file diff --git a/indivo/data_models/core/problem/example.sdmx b/indivo/data_models/core/problem/example.sdmx index 5d50d3c1..53ceda0a 100644 --- a/indivo/data_models/core/problem/example.sdmx +++ b/indivo/data_models/core/problem/example.sdmx @@ -1,9 +1,9 @@ - + 2009-05-16T12:00:00Z 2009-05-16T16:00:00Z - Backache (Finding) - http://purl.bioontology.org/ontology/SNOMEDCT/ - 161891005 + Backache (Finding) + http://purl.bioontology.org/ontology/SNOMEDCT/ + 161891005 \ No newline at end of file diff --git a/indivo/data_models/core/problem/extra.py b/indivo/data_models/core/problem/extra.py index a1803a59..4d33e6cf 100644 --- a/indivo/data_models/core/problem/extra.py +++ b/indivo/data_models/core/problem/extra.py @@ -19,8 +19,8 @@ class ProblemOptions(DataModelOptions): model_class_name = 'Problem' serializers = ProblemSerializers field_validators = { - 'name_system': [ExactValueValidator(SNOMED_URI)], - 'name_identifier': [NonNullValidator()], - 'name_title': [NonNullValidator()], + 'name_code_system': [ExactValueValidator(SNOMED_URI)], + 'name_code_identifier': [NonNullValidator()], + 'name_code_title': [NonNullValidator()], 'startDate': [NonNullValidator()], } diff --git a/indivo/data_models/core/procedure/example.py b/indivo/data_models/core/procedure/example.py index 65c90d52..7e14ffb3 100644 --- a/indivo/data_models/core/procedure/example.py +++ b/indivo/data_models/core/procedure/example.py @@ -2,16 +2,20 @@ from indivo.lib.iso8601 import parse_utc_date as date procedure_fact = Procedure( - date_performed=date("2009-05-16T12:00:00"), - name="Appendectomy", - name_type="http://codes.indivo.org/procedures#", - name_value="123", - name_abbrev="append", - provider_name="Kenneth Mandl", - provider_institution="Children's Hospital Boston", - location="300 Longwood Ave, Boston MA 02115", - comments="Went great!" + date=date("2011-02-15T12:00:00Z"), + notes="Went great!", + name_code_title="Appendectomy", + name_code_system="http://purl.bioontology.org/ontology/SNOMEDCT/", + name_code_identifier="80146002", + status_code_title="Complete", + status_code_system="http://purl.bioontology.org/ontology/SNOMEDCT/", + status_code_identifier="385658003", + provider_dea_number="325555555", + provider_npi_number="5235235", + provider_email="joshua.mandel@fake.emailserver.com", + provider_name_given="Josuha", + provider_name_family="Mandel", + provider_tel_1_type="w", + provider_tel_1_number="1-235-555-55555", + provider_tel_1_preferred_p=True, ) - - - diff --git a/indivo/data_models/core/procedure/example.sdmj b/indivo/data_models/core/procedure/example.sdmj index 5ff88e42..121841e8 100644 --- a/indivo/data_models/core/procedure/example.sdmj +++ b/indivo/data_models/core/procedure/example.sdmj @@ -1,14 +1,19 @@ { "__modelname__": "Procedure", - "date_performed": "2009-05-16T12:00:00", - "name": "Appendectomy", - "name_type": "http://codes.indivo.org/procedures#", - "name_value": "123", - "name_abbrev": "append", - "provider_name": "Kenneth Mandl", - "provider_institution": "Children's Hospital Boston", - "location": "300 Longwood Ave, Boston MA 02115", - "comments": "Went great!" + "date": "2011-02-15T12:00:00Z", + "notes": "Went great!", + "name_code_title": "Appendectomy", + "name_code_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", + "name_code_identifier": "80146002", + "status_code_title": "Complete", + "status_code_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", + "status_code_identifier": "385658003", + "provider_dea_number": "325555555", + "provider_npi_number": "5235235", + "provider_email": "joshua.mandel@fake.emailserver.com", + "provider_name_given": "Josuha", + "provider_name_family": "Mandel", + "provider_tel_1_type": "w", + "provider_tel_1_number": "1-235-947-3452", + "provider_tel_1_preferred_p": True, } - - diff --git a/indivo/data_models/core/procedure/example.sdmx b/indivo/data_models/core/procedure/example.sdmx index ac134982..25f141ed 100644 --- a/indivo/data_models/core/procedure/example.sdmx +++ b/indivo/data_models/core/procedure/example.sdmx @@ -1,15 +1,20 @@ - - 2009-05-16T12:00:00 - Appendectomy - http://codes.indivo.org/procedures# - 123 - append - Kenneth Mandl - Children's Hospital Boston - 300 Longwood Ave, Boston MA 02115 - Went great! - - - - + + 2011-02-15T12:00:00Z + Went great! + Appendectomy + http://purl.bioontology.org/ontology/SNOMEDCT/ + 80146002 + Complete + http://purl.bioontology.org/ontology/SNOMEDCT/ + 385658003 + 325555555 + 5235235 + joshua.mandel@fake.emailserver.com + Josuha + Mandel + w + 1-235-947-3452 + True + + \ No newline at end of file diff --git a/indivo/data_models/core/procedure/extra.py b/indivo/data_models/core/procedure/extra.py new file mode 100644 index 00000000..4d471733 --- /dev/null +++ b/indivo/data_models/core/procedure/extra.py @@ -0,0 +1,25 @@ +from indivo.serializers import DataModelSerializers +from indivo.data_models.options import DataModelOptions +from indivo.lib.rdf import PatientGraph +from indivo.validators import ExactValueValidator, NonNullValidator + +SNOMED_URI = 'http://purl.bioontology.org/ontology/SNOMEDCT/' + +class ProcedureSerializers(DataModelSerializers): + + def to_rdf(queryset, result_count, record=None, carenet=None): + if not record: + record = carenet.record + + graph = PatientGraph(record) + graph.addProcedureList(queryset.iterator()) + return graph.toRDF() + +class ProcedureOptions(DataModelOptions): + model_class_name = 'Procedure' + serializers = ProcedureSerializers + field_validators = { + 'name_code_system': [ExactValueValidator(SNOMED_URI)], + 'name_code_identifier': [NonNullValidator()], + 'name_code_title': [NonNullValidator()], + } diff --git a/indivo/data_models/core/procedure/model.py b/indivo/data_models/core/procedure/model.py index d0429372..87e49702 100644 --- a/indivo/data_models/core/procedure/model.py +++ b/indivo/data_models/core/procedure/model.py @@ -1,15 +1,12 @@ -from indivo.models import Fact from django.db import models -class Procedure(Fact): - date_performed = models.DateTimeField(null=True) - name = models.CharField(max_length=100) - name_type = models.CharField(max_length=80, null=True) - name_value = models.CharField(max_length=40, null=True) - name_abbrev = models.CharField(max_length=20, null=True) - provider_name = models.CharField(max_length=200, null=True) - provider_institution = models.CharField(max_length=200, null=True) - location = models.CharField(max_length=100, null=True) - comments = models.TextField(null=True) - +from indivo.fields import CodedValueField, ProviderField +from indivo.models import Fact +class Procedure(Fact): + date = models.DateTimeField(null=True) + notes = models.TextField(null=True) + name = CodedValueField() + status = CodedValueField(null=True) + provider = ProviderField(null=True) + \ No newline at end of file diff --git a/indivo/data_models/core/procedure/model.sdml b/indivo/data_models/core/procedure/model.sdml index 537ef16d..4d563d4d 100644 --- a/indivo/data_models/core/procedure/model.sdml +++ b/indivo/data_models/core/procedure/model.sdml @@ -1,6 +1,6 @@ { "__modelname__": "Procedure", - "date_performed": "Date", + "date": "Date", "name": "String", "name_type": "String", "name_value": "String", diff --git a/indivo/data_models/core/simple_clinical_note/example.sdmx b/indivo/data_models/core/simple_clinical_note/example.sdmx index 67309b45..195ff7b5 100644 --- a/indivo/data_models/core/simple_clinical_note/example.sdmx +++ b/indivo/data_models/core/simple_clinical_note/example.sdmx @@ -1,4 +1,4 @@ - + 2010-02-02T12:00:00Z 2010-02-03T13:12:00Z diff --git a/indivo/data_models/core/vitals/example.py b/indivo/data_models/core/vitals/example.py index 5632fc27..6557b569 100644 --- a/indivo/data_models/core/vitals/example.py +++ b/indivo/data_models/core/vitals/example.py @@ -17,9 +17,9 @@ provider_tel_1_type="w", provider_tel_1_number="1-235-947-3452", provider_tel_1_preferred_p=True, - encounterType_title="Ambulatory encounter", - encounterType_system="http://smartplatforms.org/terms/codes/EncounterType#", - encounterType_identifier="ambulatory", + type_code_title="Ambulatory encounter", + type_code_system="http://smartplatforms.org/terms/codes/EncounterType#", + type_code_identifier="ambulatory", ) encounter_fact.save() @@ -30,72 +30,79 @@ encounter=encounter_fact, # Blood Pressure - bp_position_title="Sitting", - bp_position_identifier="33586001", - bp_position_system="http://purl.bioontology.org/ontology/SNOMEDCT/", - bp_site_title="Right arm", - bp_site_identifier="368209003", - bp_site_system="http://purl.bioontology.org/ontology/SNOMEDCT/", - bp_method_title="Auscultation", - bp_method_identifier="auscultation", - bp_method_system="http://smartplatforms.org/terms/codes/BloodPressureMethod#", + bp_position_code_title="Sitting", + bp_position_code_identifier="33586001", + bp_position_code_system="http://purl.bioontology.org/ontology/SNOMEDCT/", + bp_site_code_title="Right arm", + bp_site_code_identifier="368209003", + bp_site_code_system="http://purl.bioontology.org/ontology/SNOMEDCT/", + bp_method_code_title="Auscultation", + bp_method_code_identifier="auscultation", + bp_method_code_system="http://smartplatforms.org/terms/codes/BloodPressureMethod#", bp_diastolic_unit="mm[Hg]", bp_diastolic_value=82, - bp_diastolic_name_title="Intravascular diastolic", - bp_diastolic_name_identifier="8462-4", - bp_diastolic_name_system="http://purl.bioontology.org/ontology/LNC/", + bp_diastolic_name_code_title="Intravascular diastolic", + bp_diastolic_name_code_identifier="8462-4", + bp_diastolic_name_code_system="http://purl.bioontology.org/ontology/LNC/", bp_systolic_unit="mm[Hg]", bp_systolic_value=132, - bp_systolic_name_title="Intravascular systolic", - bp_systolic_name_identifier="8480-6", - bp_systolic_name_system="http://purl.bioontology.org/ontology/LNC/", + bp_systolic_name_code_title="Intravascular systolic", + bp_systolic_name_code_identifier="8480-6", + bp_systolic_name_code_system="http://purl.bioontology.org/ontology/LNC/", # Body Mass Index bmi_unit="kg/m2", bmi_value=21.8, - bmi_name_title="Body mass index", - bmi_name_system="http://purl.bioontology.org/ontology/LNC/", - bmi_name_identifier="39156-5", + bmi_name_code_title="Body mass index", + bmi_name_code_system="http://purl.bioontology.org/ontology/LNC/", + bmi_name_code_identifier="39156-5", + + # Head circumference + head_circ_unit="cm", + head_circ_value=70, + head_circ_name_code_title="Head circumference", + head_circ_name_code_system="http://purl.bioontology.org/ontology/LNC/", + head_circ_name_code_identifier="8287-5", # Heart Rate heart_rate_unit="{beats}/min", heart_rate_value=70, - heart_rate_name_title="Heart rate", - heart_rate_name_system="http://purl.bioontology.org/ontology/LNC/", - heart_rate_name_identifier="8867-4", + heart_rate_name_code_title="Heart rate", + heart_rate_name_code_system="http://purl.bioontology.org/ontology/LNC/", + heart_rate_name_code_identifier="8867-4", # Height height_unit="m", height_value=1.8, - height_name_title="Body height", - height_name_system="http://purl.bioontology.org/ontology/LNC/", - height_name_identifier="8302-2", + height_name_code_title="Body height", + height_name_code_system="http://purl.bioontology.org/ontology/LNC/", + height_name_code_identifier="8302-2", # Oxygen Saturation oxygen_saturation_unit="%{HemoglobinSaturation}", oxygen_saturation_value=99, - oxygen_saturation_name_title="Oxygen saturation", - oxygen_saturation_name_system="http://purl.bioontology.org/ontology/LNC/", - oxygen_saturation_name_identifier="2710-2", + oxygen_saturation_name_code_title="Oxygen saturation", + oxygen_saturation_name_code_system="http://purl.bioontology.org/ontology/LNC/", + oxygen_saturation_name_code_identifier="2710-2", # Respiratory Rate respiratory_rate_unit="{breaths}/min", respiratory_rate_value=16, - respiratory_rate_name_title="Respiration rate", - respiratory_rate_name_system="http://purl.bioontology.org/ontology/LNC/", - respiratory_rate_name_identifier="9279-1", + respiratory_rate_name_code_title="Respiration rate", + respiratory_rate_name_code_system="http://purl.bioontology.org/ontology/LNC/", + respiratory_rate_name_code_identifier="9279-1", # Temperature temperature_unit="Cel", temperature_value=37, - temperature_name_title="Body temperature", - temperature_name_system="http://purl.bioontology.org/ontology/LNC/", - temperature_name_identifier="8310-5", + temperature_name_code_title="Body temperature", + temperature_name_code_system="http://purl.bioontology.org/ontology/LNC/", + temperature_name_code_identifier="8310-5", # Weight weight_unit="kg", weight_value=70.8, - weight_name_title="Body weight", - weight_name_system="http://purl.bioontology.org/ontology/LNC/", - weight_name_identifier="3141-9", + weight_name_code_title="Body weight", + weight_name_code_system="http://purl.bioontology.org/ontology/LNC/", + weight_name_code_identifier="3141-9", ) diff --git a/indivo/data_models/core/vitals/example.sdmj b/indivo/data_models/core/vitals/example.sdmj index 484cc885..1d822bcb 100644 --- a/indivo/data_models/core/vitals/example.sdmj +++ b/indivo/data_models/core/vitals/example.sdmj @@ -18,70 +18,76 @@ "provider_tel_1_type": "w", "provider_tel_1_number": "1-235-947-3452", "provider_tel_1_preferred_p": true, - "encounterType_title": "Ambulatory encounter", - "encounterType_system": "http://smartplatforms.org/terms/codes/EncounterType#", - "encounterType_identifier": "ambulatory" + "type_code_title": "Ambulatory encounter", + "type_code_system": "http://smartplatforms.org/terms/codes/EncounterType#", + "type_code_identifier": "ambulatory" }, "bp_position_title": "Sitting", "bp_position_identifier": "33586001", "bp_position_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", - "bp_site_title": "Right arm", - "bp_site_identifier": "368209003", - "bp_site_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", - "bp_method_title": "Auscultation", - "bp_method_identifier": "auscultation", - "bp_method_system": "http://smartplatforms.org/terms/codes/BloodPressureMethod#", + "bp_site_code_title": "Right arm", + "bp_site_code_identifier": "368209003", + "bp_site_code_system": "http://purl.bioontology.org/ontology/SNOMEDCT/", + "bp_method_code_title": "Auscultation", + "bp_method_code_identifier": "auscultation", + "bp_method_code_system": "http://smartplatforms.org/terms/codes/BloodPressureMethod#", "bp_diastolic_unit": "mm[Hg]", "bp_diastolic_value": 82, - "bp_diastolic_name_title": "Intravascular diastolic", - "bp_diastolic_name_identifier": "8462-4", - "bp_diastolic_name_system": "http://purl.bioontology.org/ontology/LNC/", + "bp_diastolic_name_code_title": "Intravascular diastolic", + "bp_diastolic_name_code_identifier": "8462-4", + "bp_diastolic_name_code_system": "http://purl.bioontology.org/ontology/LNC/", "bp_systolic_unit": "mm[Hg]", "bp_systolic_value": 132, - "bp_systolic_name_title": "Intravascular systolic", - "bp_systolic_name_identifier": "8480-6", - "bp_systolic_name_system": "http://purl.bioontology.org/ontology/LNC/", + "bp_systolic_name_code_title": "Intravascular systolic", + "bp_systolic_name_code_identifier": "8480-6", + "bp_systolic_name_code_system": "http://purl.bioontology.org/ontology/LNC/", "bmi_unit": "kg/m2", "bmi_value": 21.8, - "bmi_name_title": "Body mass index", - "bmi_name_system": "http://purl.bioontology.org/ontology/LNC/", - "bmi_name_identifier": "39156-5", + "bmi_name_code_title": "Body mass index", + "bmi_name_code_system": "http://purl.bioontology.org/ontology/LNC/", + "bmi_name_code_identifier": "39156-5", + + "head_circ_unit": "cm", + "head_circ_value": 70, + "head_circ_name_code_title": "Head circumference", + "head_circ_name_code_system": "http://purl.bioontology.org/ontology/LNC/", + "head_circ_name_code_identifier": "8287-5", "heart_rate_unit": "{beats}/min", "heart_rate_value": 70, - "heart_rate_name_title": "Heart rate", - "heart_rate_name_system": "http://purl.bioontology.org/ontology/LNC/", - "heart_rate_name_identifier": "8867-4", + "heart_rate_name_code_title": "Heart rate", + "heart_rate_name_code_system": "http://purl.bioontology.org/ontology/LNC/", + "heart_rate_name_code_identifier": "8867-4", "height_unit": "m", "height_value": 1.8, - "height_name_title": "Body height", - "height_name_system": "http://purl.bioontology.org/ontology/LNC/", - "height_name_identifier": "8302-2", + "height_name_code_title": "Body height", + "height_name_code_system": "http://purl.bioontology.org/ontology/LNC/", + "height_name_code_identifier": "8302-2", "oxygen_saturation_unit": "%{HemoglobinSaturation}", "oxygen_saturation_value": 99, - "oxygen_saturation_name_title": "Oxygen saturation", - "oxygen_saturation_name_system": "http://purl.bioontology.org/ontology/LNC/", - "oxygen_saturation_name_identifier": "2710-2", + "oxygen_saturation_name_code_title": "Oxygen saturation", + "oxygen_saturation_name_code_system": "http://purl.bioontology.org/ontology/LNC/", + "oxygen_saturation_name_code_identifier": "2710-2", "respiratory_rate_unit": "{breaths}/min", "respiratory_rate_value": 16, - "respiratory_rate_name_title": "Respiration rate", - "respiratory_rate_name_system": "http://purl.bioontology.org/ontology/LNC/", - "respiratory_rate_name_identifier": "9279-1", + "respiratory_rate_name_code_title": "Respiration rate", + "respiratory_rate_name_code_system": "http://purl.bioontology.org/ontology/LNC/", + "respiratory_rate_name_code_identifier": "9279-1", "temperature_unit": "Cel", "temperature_value": 37, - "temperature_name_title": "Body temperature", - "temperature_name_system": "http://purl.bioontology.org/ontology/LNC/", - "temperature_name_identifier": "8310-5", + "temperature_name_code_title": "Body temperature", + "temperature_name_code_system": "http://purl.bioontology.org/ontology/LNC/", + "temperature_name_code_identifier": "8310-5", "weight_unit": "kg", "weight_value": 70.8, - "weight_name_title": "Body weight", - "weight_name_system": "http://purl.bioontology.org/ontology/LNC/", - "weight_name_identifier": "3141-9" + "weight_name_code_title": "Body weight", + "weight_name_code_system": "http://purl.bioontology.org/ontology/LNC/", + "weight_name_code_identifier": "3141-9" } diff --git a/indivo/data_models/core/vitals/example.sdmx b/indivo/data_models/core/vitals/example.sdmx index a0936ca5..b7ecbe54 100644 --- a/indivo/data_models/core/vitals/example.sdmx +++ b/indivo/data_models/core/vitals/example.sdmx @@ -1,4 +1,4 @@ - + 2009-05-16T12:00:00Z @@ -18,64 +18,69 @@ w 1-235-947-3452 true - Ambulatory encounter - http://smartplatforms.org/terms/codes/EncounterType# - ambulatory + Ambulatory encounter + http://smartplatforms.org/terms/codes/EncounterType# + ambulatory - Sitting - 33586001 - http://purl.bioontology.org/ontology/SNOMEDCT/ - Right arm - 368209003 - http://purl.bioontology.org/ontology/SNOMEDCT/ - Auscultation - auscultation - http://smartplatforms.org/terms/codes/BloodPressureMethod# + Sitting + 33586001 + http://purl.bioontology.org/ontology/SNOMEDCT/ + Right arm + 368209003 + http://purl.bioontology.org/ontology/SNOMEDCT/ + Auscultation + auscultation + http://smartplatforms.org/terms/codes/BloodPressureMethod# mm[Hg] 82 - Intravascular diastolic - 8462-4 - http://purl.bioontology.org/ontology/LNC/ + Intravascular diastolic + 8462-4 + http://purl.bioontology.org/ontology/LNC/ mm[Hg] 132 - Intravascular systolic - 8480-6 - http://purl.bioontology.org/ontology/LNC/ + Intravascular systolic + 8480-6 + http://purl.bioontology.org/ontology/LNC/ kg/m2 21.8 - Body mass index - http://purl.bioontology.org/ontology/LNC/ - 39156-5 + Body mass index + http://purl.bioontology.org/ontology/LNC/ + 39156-5 {beats}/min 70 - Heart rate - http://purl.bioontology.org/ontology/LNC/ - 8867-4 + Heart rate + http://purl.bioontology.org/ontology/LNC/ + 8867-4 m 1.8 - Body height - http://purl.bioontology.org/ontology/LNC/ - 8302-2 + Body height + http://purl.bioontology.org/ontology/LNC/ + 8302-2 %{HemoglobinSaturation} 99 - Oxygen saturation - http://purl.bioontology.org/ontology/LNC/ - 2710-2 + Oxygen saturation + http://purl.bioontology.org/ontology/LNC/ + 2710-2 {breaths}/min 16 - Respiration rate - http://purl.bioontology.org/ontology/LNC/ - 9279-1 + Respiration rate + http://purl.bioontology.org/ontology/LNC/ + 9279-1 Cel 37 - Body temperature - http://purl.bioontology.org/ontology/LNC/ - 8310-5 + Body temperature + http://purl.bioontology.org/ontology/LNC/ + 8310-5 kg 70.8 - Body weight - http://purl.bioontology.org/ontology/LNC/ - 3141-9 + Body weight + http://purl.bioontology.org/ontology/LNC/ + 3141-9 + cm + 70 + Head circumference + http://purl.bioontology.org/ontology/LNC/ + 8287-5 diff --git a/indivo/data_models/core/vitals/extra.py b/indivo/data_models/core/vitals/extra.py index ec1844c7..6369c635 100644 --- a/indivo/data_models/core/vitals/extra.py +++ b/indivo/data_models/core/vitals/extra.py @@ -39,6 +39,7 @@ 'resp_rate': ['9279-1'], # Respiration rate 'temperature': ['8310-5'], # Body temperature 'weight': ['3141-9'], # Body weight + 'head_circ': ['8287-5'] # Head circumference } UNITS = { @@ -50,6 +51,7 @@ 'resp_rate': ['{breaths}/min'], 'temperature': ['Cel'], 'weight': ['kg'], + 'head_circ': ['cm'], } ENC_TYPES = [ @@ -74,9 +76,9 @@ 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()], + 'type_code_system': [ExactValueValidator(ENC_TYPE_URI)], + 'type_code_identifier': [ValueInSetValidator(ENC_TYPES)], + 'type_code_title': [NonNullValidator()], 'startDate': [NonNullValidator()], } @@ -96,46 +98,46 @@ class VitalsOptions(DataModelOptions): 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_position_code_system': [ExactValueValidator(SNOMED_URI, nullable=True)], + 'bp_position_code_identifier': [ValueInSetValidator(BP_POSITION_IDS, nullable=True)], + 'bp_site_code_system': [ExactValueValidator(SNOMED_URI, nullable=True)], + 'bp_site_code_identifier': [ValueInSetValidator(BP_SITE_IDS, nullable=True)], + 'bp_method_code_system': [ExactValueValidator(BP_METHOD_URI, nullable=True)], + 'bp_method_code_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_diastolic_name_code_system': [ExactValueValidator(LOINC_URI, nullable=True)], + 'bp_diastolic_name_code_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)], + 'bp_systolic_name_code_system': [ExactValueValidator(LOINC_URI, nullable=True)], + 'bp_systolic_name_code_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)], + 'bmi_name_code_system': [ExactValueValidator(LOINC_URI, nullable=True)], + 'bmi_name_code_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)], + 'heart_rate_name_code_system': [ExactValueValidator(LOINC_URI, nullable=True)], + 'heart_rate_name_code_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)], + 'height_name_code_system': [ExactValueValidator(LOINC_URI, nullable=True)], + 'height_name_code_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)], + 'oxygen_saturation_name_code_system': [ExactValueValidator(LOINC_URI, nullable=True)], + 'oxygen_saturation_name_code_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)], + 'respiratory_rate_name_code_system': [ExactValueValidator(LOINC_URI, nullable=True)], + 'respiratory_rate_name_code_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)], + 'temperature_name_code_system': [ExactValueValidator(LOINC_URI, nullable=True)], + 'temperature_name_code_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)], + 'head_circ_unit': [ValueInSetValidator(UNITS['head_circ'], nullable=True)], + 'head_circ_name_code_system': [ExactValueValidator(LOINC_URI, nullable=True)], + 'head_circ_name_code_identifier': [ValueInSetValidator(VITAL_SIGN_IDS['head_circ'], nullable=True)], } diff --git a/indivo/data_models/core/vitals/model.py b/indivo/data_models/core/vitals/model.py index c78a91fa..8686f0ff 100644 --- a/indivo/data_models/core/vitals/model.py +++ b/indivo/data_models/core/vitals/model.py @@ -13,13 +13,14 @@ class VitalSigns(Fact): respiratory_rate = VitalSignField() temperature = VitalSignField() weight = VitalSignField() + head_circ = VitalSignField() class Encounter(Fact): - startDate = models.DateTimeField(null=True) - endDate = models.DateTimeField(null=True) - facility = OrganizationField() - provider = ProviderField() - encounterType = CodedValueField() + startDate = models.DateTimeField(null=True) + endDate = models.DateTimeField(null=True) + facility = OrganizationField() + provider = ProviderField() + type = CodedValueField() diff --git a/indivo/data_models/core/vitals/model.sdml b/indivo/data_models/core/vitals/model.sdml index d434021d..f9acbd09 100644 --- a/indivo/data_models/core/vitals/model.sdml +++ b/indivo/data_models/core/vitals/model.sdml @@ -7,7 +7,7 @@ "endDate": "Date", "facility": "Organization", "provider": "Provider", - "encounterType": "CodedValue" + "type": "CodedValue" }, "bp": "BloodPressure", "bmi": "VitalSign", diff --git a/indivo/fields/dummy_fields.py b/indivo/fields/dummy_fields.py index 3ee34387..8c3a7081 100644 --- a/indivo/fields/dummy_fields.py +++ b/indivo/fields/dummy_fields.py @@ -14,14 +14,58 @@ class DummyField(models.Field): """ replacements = {} +class CodeField(DummyField): + """ A field for representing code data elements. + + Creating a CodeField named 'value', for example, will (under the hood) create these fields: + + * ``value_identifier``, the system-specific identifier that represents the element (i.e. an RXNorm LOINC) + * ``value_title``, the human-readable title of the element + * ``value_system``, the coding system used to represent the element + + When describing instances of your model (either when defining a + :ref:`transform output ` or when referencing fields using + :ref:`the Indivo Query API `), you must refer to these field names, not the original + ``value`` field name. + + """ + + replacements = { + 'identifier': (models.CharField, {'max_length':255, 'null':True, 'db_column':'id'}), + 'title': (models.CharField, {'max_length':255, 'null':True}), + 'system': (models.CharField, {'max_length':255, 'null':True, 'db_column':'sys'}), + } + +class CodeProvenanceField(DummyField): + """ A field for representing the provenance of a Code. + + Creating a CodeProvenanceField named 'value', for example, will (under the hood) create the fields: + + * ``value_source_code``, URI for the source code + * ``value_title``, the human-readable title of the element + * ``value_translation_fidelity_*``, fields defined in :py:class:`~indivo.fields.TranslationFidelityField` + + When describing instances of your model (either when defining a + :ref:`transform output ` or when referencing fields using + :ref:`the Indivo Query API `), you must refer to these field names, not the original + ``value`` field name. + + """ + + replacements = { + 'source_code': (models.CharField, {'max_length':255, 'null':True, 'db_column':'sc'}), + 'title': (models.CharField, {'max_length':255, 'null':True}), + 'translation_fidelity': (CodeField, {'db_column':'tf'}), + } + class CodedValueField(DummyField): """ A field for representing coded data elements. - Creating a CodedValueField named 'value', for example, will (under the hood) create thee fields: + Creating a CodedValueField named 'value', for example, will (under the hood) create the fields: - * ``value_identifier``, the system-specific identifier that represents the element (i.e. an RXNorm CUI) * ``value_title``, the human-readable title of the element - * ``value_system``, the coding system used to represent the element + * ``value_code_*``, fields defined in :py:class:`~indivo.fields.CodeField` + * ``value_provenance_*``, fields defined in :py:class:`~indivo.fields.CodeProvenanceField` When describing instances of your model (either when defining a :ref:`transform output ` or when referencing fields using @@ -31,9 +75,9 @@ class CodedValueField(DummyField): """ replacements = { - '_identifier': (models.CharField, {'max_length':255, 'null':True}), - '_title': (models.CharField, {'max_length':255, 'null':True}), - '_system': (models.CharField, {'max_length':255, 'null':True}), + 'title': (models.CharField, {'max_length':255, 'null':True}), + 'code': (CodeField, {}), + 'provenance': (CodeProvenanceField, {'db_column':'prov'}), } class ValueAndUnitField(DummyField): @@ -52,8 +96,8 @@ class ValueAndUnitField(DummyField): """ replacements = { - '_value': (models.CharField, {'max_length':255, 'null':True}), # consider making this a float? - '_unit': (models.CharField, {'max_length':255, 'null':True}), + 'value': (models.CharField, {'max_length':255, 'null':True}), # consider making this a float? + 'unit': (models.CharField, {'max_length':255, 'null':True}), } class ValueRangeField(DummyField): @@ -72,8 +116,8 @@ class ValueRangeField(DummyField): """ replacements = { - '_max': (ValueAndUnitField, {}), - '_min': (ValueAndUnitField, {}), + 'max': (ValueAndUnitField, {}), + 'min': (ValueAndUnitField, {}), } class QuantitativeResultField(DummyField): @@ -93,9 +137,9 @@ class QuantitativeResultField(DummyField): """ replacements = { - '_non_critical_range': (ValueRangeField, {}), - '_normal_range': (ValueRangeField, {}), - '_value': (ValueAndUnitField, {}), + 'non_critical_range': (ValueRangeField, {}), + 'normal_range': (ValueRangeField, {}), + 'value': (ValueAndUnitField, {}), } class AddressField(DummyField): @@ -118,11 +162,11 @@ class AddressField(DummyField): """ replacements = { - '_country': (models.CharField, {'max_length':255, 'null':True}), - '_city': (models.CharField, {'max_length':255, 'null':True}), - '_postalcode': (models.CharField, {'max_length':12, 'null':True}), - '_region': (models.CharField, {'max_length':255, 'null':True}), - '_street': (models.CharField, {'max_length':255, 'null':True}), + 'country': (models.CharField, {'max_length':255, 'null':True}), + 'city': (models.CharField, {'max_length':255, 'null':True}), + 'postalcode': (models.CharField, {'max_length':12, 'null':True}), + 'region': (models.CharField, {'max_length':255, 'null':True}), + 'street': (models.CharField, {'max_length':255, 'null':True}), } class OrganizationField(DummyField): @@ -141,8 +185,8 @@ class OrganizationField(DummyField): """ replacements = { - '_name': (models.CharField, {'max_length':255, 'null':True}), - '_adr': (AddressField, {}), + 'name': (models.CharField, {'max_length':255, 'null':True}), + 'adr': (AddressField, {}), } class PharmacyField(DummyField): @@ -162,9 +206,9 @@ class PharmacyField(DummyField): """ replacements = { - '_ncpdpid': (models.CharField, {'max_length':255, 'null':True}), - '_org': (models.CharField, {'max_length':255, 'null':True}), - '_adr': (AddressField, {}), + 'ncpdpid': (models.CharField, {'max_length':255, 'null':True}), + 'org': (models.CharField, {'max_length':255, 'null':True}), + 'adr': (AddressField, {}), } class NameField(DummyField): @@ -186,11 +230,11 @@ class NameField(DummyField): """ replacements = { - '_family': (models.CharField, {'max_length':255, 'null':True}), - '_given': (models.CharField, {'max_length':255, 'null':True}), - '_middle': (models.CharField, {'max_length':255, 'null':True}), - '_prefix': (models.CharField, {'max_length':255, 'null':True}), - '_suffix': (models.CharField, {'max_length':255, 'null':True}), + 'family': (models.CharField, {'max_length':255, 'null':True}), + 'given': (models.CharField, {'max_length':255, 'null':True}), + 'middle': (models.CharField, {'max_length':255, 'null':True}), + 'prefix': (models.CharField, {'max_length':255, 'null':True}), + 'suffix': (models.CharField, {'max_length':255, 'null':True}), } class TelephoneField(DummyField): @@ -212,9 +256,9 @@ class TelephoneField(DummyField): phone_number_type_choices = ( ('h', 'Home'), ('w', 'Work'), ('c', 'Cell'), ) replacements = { - '_type': (models.CharField, {'max_length':1, 'null':True, 'choices':phone_number_type_choices}), - '_number': (models.CharField, {'max_length':20, 'null':True}), - '_preferred_p': (models.BooleanField, {'default':False}), + 'type': (models.CharField, {'max_length':1, 'null':True, 'choices':phone_number_type_choices}), + 'number': (models.CharField, {'max_length':20, 'null':True}), + 'preferred_p': (models.BooleanField, {'default':False}), } class ProviderField(DummyField): @@ -245,18 +289,18 @@ class ProviderField(DummyField): gender_choices = ( ('m', 'male'), ('f', 'female'), ) replacements = { - '_dea_number': (models.CharField, {'max_length':255, 'null':True}), - '_ethnicity': (models.CharField, {'max_length':255, 'null':True}), - '_npi_number': (models.CharField, {'max_length':255, 'null':True}), - '_preferred_language': (models.CharField, {'max_length':255, 'null':True}), - '_race': (models.CharField, {'max_length':255, 'null':True}), - '_adr': (AddressField, {}), - '_bday': (models.DateField, {'null':True}), - '_email': (models.EmailField, {'max_length':255, 'null':True}), - '_name': (NameField, {'max_length':255, 'null':True}), - '_tel_1': (TelephoneField, {'max_length':255, 'null':True}), - '_tel_2': (TelephoneField, {'max_length':255, 'null':True}), - '_gender': (models.CharField, {'max_length':255, 'null':True, 'choices':gender_choices}), + 'dea_number': (models.CharField, {'max_length':255, 'null':True}), + 'ethnicity': (models.CharField, {'max_length':255, 'null':True}), + 'npi_number': (models.CharField, {'max_length':255, 'null':True}), + 'preferred_language': (models.CharField, {'max_length':255, 'null':True}), + 'race': (models.CharField, {'max_length':255, 'null':True}), + 'adr': (AddressField, {}), + 'bday': (models.DateField, {'null':True}), + 'email': (models.EmailField, {'max_length':255, 'null':True}), + 'name': (NameField, {'max_length':255, 'null':True}), + 'tel_1': (TelephoneField, {'max_length':255, 'null':True}), + 'tel_2': (TelephoneField, {'max_length':255, 'null':True}), + 'gender': (models.CharField, {'max_length':255, 'null':True, 'choices':gender_choices}), } class VitalSignField(DummyField): @@ -276,9 +320,9 @@ class VitalSignField(DummyField): """ replacements = { - '_unit': (models.CharField, {'max_length':255, 'null':True}), - '_value': (models.FloatField, {'null':True}), - '_name': (CodedValueField, {}), + 'unit': (models.CharField, {'max_length':255, 'null':True}), + 'value': (models.FloatField, {'null':True}), + 'name': (CodedValueField, {}), } class BloodPressureField(DummyField): @@ -300,9 +344,9 @@ class BloodPressureField(DummyField): """ replacements = { - '_position': (CodedValueField, {}), - '_site': (CodedValueField, {}), - '_method': (CodedValueField, {}), - '_diastolic': (VitalSignField, {}), - '_systolic': (VitalSignField, {}), + 'position': (CodedValueField, {}), + 'site': (CodedValueField, {}), + 'method': (CodedValueField, {}), + 'diastolic': (VitalSignField, {}), + 'systolic': (VitalSignField, {}), } diff --git a/indivo/lib/rdf.py b/indivo/lib/rdf.py index d171127d..ad887660 100644 --- a/indivo/lib/rdf.py +++ b/indivo/lib/rdf.py @@ -108,7 +108,6 @@ def addDemographics(self, record): def addMedList(self, meds): """Adds a MedList to a patient's graph""" - g = self.g if not meds: return # no meds for m in meds: @@ -181,12 +180,9 @@ def addProblemList(self, problems): g.add((pnode, SP['endDate'], Literal(prob.endDate))) if prob.notes: g.add((pnode, SP['notes'], Literal(prob.notes))) - g.add((pnode, SP['problemName'], - self.codedValue(SPCODE["SNOMED"], - SNOMED_URI%prob.name_identifier, - prob.name_title, - SNOMED_URI%"", - prob.name_identifier))) + + problem_name = self._getCodedValueFromField(prob, 'name', [SPCODE['SNOMED']]) + g.add((pnode, SP['problemName'], self.newCodedValue(problem_name))) self.addStatement(pnode) def addEncounterList(self, encounters): @@ -203,7 +199,7 @@ def addVitalsList(self, vitals): for v in vitals: vnode = URIRef(v.uri('vital_signs')) - g.add((vnode, RDF.type, SP['VitalSigns'])) + g.add((vnode, RDF.type, SP['VitalSignSet'])) g.add((vnode, DCTERMS['date'], Literal(v.date))) enode = self.encounter(v.encounter) @@ -241,6 +237,10 @@ def addVitalsList(self, vitals): wNode = self.vital(v, 'weight') if wNode: g.add((vnode, SP['weight'], wNode)) + + hcNode = self.vital(v, 'head_circ') + if hcNode: + g.add((hcNode, SP['headCircumference'], hcNode)) self.addStatement(vnode) @@ -254,47 +254,24 @@ def addImmunizationList(self, immunizations): g.add((inode, RDF.type, SP['Immunization'])) g.add((inode, DCTERMS['date'], Literal(i.date))) - g.add((inode, SP['administrationStatus'], - self.codedValue( - SPCODE["ImmunizationAdministrationStatus"], - IMM_STATUS_URI%i.administration_status_identifier, - i.administration_status_title, - IMM_STATUS_URI%"", - i.administration_status_identifier))) - g.add((inode, SP['productName'], - self.codedValue( - SPCODE['ImmunizationProduct'], - IMM_PROD_URI%i.product_name_identifier, - i.product_name_title, - IMM_PROD_URI%"", - i.product_name_identifier))) + + admin_status = self._getCodedValueFromField(i, 'administration_status', [SPCODE['ImmunizationAdministrationStatus']]) + g.add((inode, SP['administrationStatus'], self.newCodedValue(admin_status))) + + product_name = self._getCodedValueFromField(i, 'product_name', [SPCODE['ImmunizationProduct']]) + g.add((inode, SP['productName'], self.newCodedValue(product_name))) + product_class = self._getCodedValueFromField(i, 'product_class', [SPCODE['ImmunizationClass']]) if i.product_class_title and i.product_class_identifier: - g.add((inode, SP['productClass'], - self.codedValue( - SPCODE['ImmunizationClass'], - IMM_CLASS_URI%i.product_class_identifier, - i.product_class_title, - IMM_CLASS_URI%"", - i.product_class_identifier))) + g.add((inode, SP['productClass'], self.newCodedValue(product_class))) + product_class2 = self._getCodedValueFromField(i, 'product_class_2', [SPCODE['ImmunizationClass']]) if i.product_class_2_title and i.product_class_2_identifier: - g.add((inode, SP['productClass'], - self.codedValue( - SPCODE['ImmunizationClass'], - IMM_CLASS_URI%i.product_class_2_identifier, - i.product_class_2_title, - IMM_CLASS_URI%"", - i.product_class_2_identifier))) + g.add((inode, SP['productClass'], self.newCodedValue(product_class2))) + refusal_reason = self._getCodedValueFromField(i, 'refusal_reason', [SPCODE['ImmunizationRefusalReason']]) if i.refusal_reason_title and i.refusal_reason_identifier: - g.add((inode, SP['refusalReason'], - self.codedValue( - SPCODE['ImmunizationRefusalReason'], - IMM_REFUSE_URI%i.refusal_reason_identifier, - i.refusal_reason_title, - IMM_REFUSE_URI%"", - i.refusal_reason_identifier))) + g.add((inode, SP['refusalReason'], self.newCodedValue(refusal_reason))) self.addStatement(inode) @@ -306,34 +283,19 @@ def addLabList(self, labs): lNode = URIRef(lab.uri('lab_results')) g.add((lNode, RDF.type, SP['LabResult'])) - g.add((lNode , SP['labName'], - self.codedValue( - SPCODE["LOINC"], - LOINC_URI%lab.test_name_identifier, - lab.test_name_title, - LOINC_URI%"", - lab.test_name_identifier))) + lab_name = self._getCodedValueFromField(lab, 'name', [SPCODE['LOINC']]) + g.add((lNode , SP['labName'], self.newCodedValue(lab_name))) if lab.abnormal_interpretation_title and lab.abnormal_interpretation_identifier: - g.add((lNode, SP['abnormalInterpretation'], - self.codedValue( - SPCODE['LabResultInterpretation'], - LAB_INTERP_URI%lab.abnormal_interpretation_identifier, - lab.abnormal_interpretation_title, - LAB_INTERP_URI%"", - lab.abnormal_interpretation_identifier))) + abnormal_interpretation = self._getCodedValueFromField(lab, 'abnormal_interpretation', [SPCODE['LabResultInterpretation']]) + g.add((lNode, SP['abnormalInterpretation'], self.newCodedValue(abnormal_interpretation))) if lab.accession_number: g.add((lNode, SP['accessionNumber'], Literal(lab.accession_number))) if lab.status_title and lab.status_identifier: - g.add((lNode, SP['labStatus'], - self.codedValue( - SPCODE['LabResultStatus'], - LAB_STATUS_URI%lab.status_identifier, - lab.status_title, - LAB_STATUS_URI%"", - lab.status_identifier))) + lab_status = self._getCodedValueFromField(lab, 'status', [SPCODE['LabResultStatus']]) + g.add((lNode, SP['labStatus'], self.newCodedValue(lab_status))) if lab.narrative_result: nrNode = BNode() @@ -348,41 +310,7 @@ def addLabList(self, labs): if qrNode: g.add((lNode, SP['quantitativeResult'], qrNode)) - # Add the specimenCollected node, but only if its subNodes should be added. - # Implemented with booleans which are set to True by the child - # if the parent node should be added - add_attr = False - attrNode = BNode() - if lab.collected_at: - add_attr = True - g.add((attrNode, SP['startDate'], Literal(lab.collected_at))) - - add_participant = False - pNode = BNode() - if lab.collected_by_role: - add_participant = True - g.add((pNode, SP['role'], Literal(lab.collected_by_role))) - oNode = self.organization(lab, 'collected_by_org') - if oNode: - add_participant = True - g.add((pNode, SP['organization'], oNode)) - personNode = BNode() - nameNode = self.name(lab, 'collected_by_name') - if nameNode: - add_participant = True - g.add((personNode, RDF.type, SP['Person'])) - g.add((personNode, VCARD['n'], nameNode)) - g.add((pNode, SP['person'], personNode)) - - if add_participant: - add_attr = True - g.add((pNode, RDF.type, SP['Participant'])) - g.add((attrNode, SP['participant'], pNode)) - - if add_attr: - g.add((attrNode, RDF.type, SP['Attribution'])) - g.add((lNode, SP['specimenCollected'], attrNode)) - + self.addStatement(lNode) def addAllergyExclusions(self, exclusions): @@ -392,13 +320,8 @@ def addAllergyExclusions(self, exclusions): for e in exclusions: aExcept = URIRef(e.uri('allergy_exclusions')) g.add((aExcept, RDF.type, SP['AllergyExclusion'])) - g.add((aExcept, SP['allergyExclusionName'], - self.codedValue( - SPCODE["AllergyExclusion"], - SNOMED_URI%e.name_identifier, - e.name_title, - SNOMED_URI%'', - e.name_identifier))) + exclusion_name = self._getCodedValueFromField(e, 'name', [SPCODE["AllergyExclusion"]]) + g.add((aExcept, SP['allergyExclusionName'], self.newCodedValue(exclusion_name))) self.addStatement(aExcept) def addAllergyList(self, allergies): @@ -408,56 +331,57 @@ def addAllergyList(self, allergies): for a in allergies: aNode = URIRef(a.uri('allergies')) g.add((aNode, RDF.type, SP['Allergy'])) - g.add((aNode, SP['severity'], - self.codedValue( - SPCODE["AllergySeverity"], - SNOMED_URI%a.severity_identifier, - a.severity_title, - SNOMED_URI%'', - a.severity_identifier))) - g.add((aNode, SP['allergicReaction'], - self.codedValue( - SPCODE["SNOMED"], - SNOMED_URI%a.allergic_reaction_identifier, - a.allergic_reaction_title, - SNOMED_URI%'', - a.allergic_reaction_identifier))) - g.add((aNode, SP['category'], - self.codedValue( - SPCODE["AllergyCategory"], - SNOMED_URI%a.category_identifier, - a.category_title, - SNOMED_URI%'', - a.category_identifier))) - - if a.drug_allergen_identifier and a.drug_allergen_title: - g.add((aNode, SP['drugAllergen'], - self.codedValue( - SPCODE["RxNorm_Ingredient"], - RXN_URI%a.drug_allergen_identifier, - a.drug_allergen_title, - RXN_URI%'', - a.drug_allergen_identifier))) - - elif a.drug_class_allergen_identifier and a.drug_class_allergen_title: - g.add((aNode, SP['drugClassAllergen'], - self.codedValue( - SPCODE["NDFRT"], - NUI_URI%a.drug_class_allergen_identifier, - a.drug_class_allergen_title, - NUI_URI%'', - a.drug_class_allergen_identifier))) - - elif a.food_allergen_identifier and a.food_allergen_title: - g.add((aNode, SP['foodAllergen'], - self.codedValue( - SPCODE["UNII"], - UNII_URI%a.food_allergen_identifier, - a.food_allergen_title, - UNII_URI%'', - a.food_allergen_identifier))) + + severity = self._getCodedValueFromField(a, 'severity', [SPCODE["AllergySeverity"]]) + g.add((aNode, SP['severity'], self.newCodedValue(severity))) + + reaction = self._getCodedValueFromField(a, 'allergic_reaction', [SPCODE["SNOMED"]]) + g.add((aNode, SP['allergicReaction'], self.newCodedValue(reaction))) + + category = self._getCodedValueFromField(a, 'category', [SPCODE["AllergyCategory"]]) + g.add((aNode, SP['category'], self.newCodedValue(category))) + + if a.drug_allergen_code_identifier and a.drug_allergen_code_title: + drug_allergen = self._getCodedValueFromField(a, 'drug_allergen', [SPCODE["RxNorm_Ingredient"]]) + g.add((aNode, SP['drugAllergen'], self.newCodedValue(drug_allergen))) + + elif a.drug_class_allergen_code_identifier and a.drug_class_allergen_code_title: + drug_class_allergen = self._getCodedValueFromField(a, 'drug_class_allergen', [SPCODE["NDFRT"]]) + g.add((aNode, SP['drugClassAllergen'], self.newCodedValue(drug_class_allergen))) + + elif a.other_allergen_code_identifier and a.other_allergen_code_title: + other_allergen = self._getCodedValueFromField(a, 'other_allergen', [SPCODE["UNII"]]) + g.add((aNode, SP['otherAllergen'], self.newCodedValue(other_allergen))) self.addStatement(aNode) + def addProcedureList(self, procedures): + """Add procedures to a patient's graph""" + g = self.g + + for procedure in procedures: + pnode = URIRef(procedure.uri()) + g.add((pnode, RDF.type, SP['Procedure'])) + + # required + procedure_name = self._getCodedValueFromField(procedure, 'name', [SPCODE['SNOMED']]) + g.add((pnode, SP['procedureName'], self.newCodedValue(procedure_name))) + + # optional + if procedure.date: + g.add((pnode, SP['date'], Literal(procedure.date))) + if procedure.notes: + g.add((pnode, SP['notes'], Literal(procedure.notes))) + + procedure_status = self._getCodedValueFromField(procedure, 'status', [SPCODE['SNOMED']]) + if procedure_status: + g.add((pnode, SP['procedureStatus'], self.newCodedValue(procedure_status))) + + procedure_provider = self.provider(procedure, 'provider') + if procedure_provider: + g.add((pnode, SP['provider'], procedure_provider)) + + self.addStatement(pnode) + ##################################################### ### Helper Methods for reusable low-level objects ### ##################################################### @@ -480,12 +404,8 @@ def encounter(self, encounter): if provNode: g.add((eNode, SP['provider'], provNode)) - g.add((eNode, SP['encounterType'], - self.codedValue(SPCODE["EncounterType"], - ENC_TYPE_URI%encounter.encounterType_identifier, - encounter.encounterType_title, - ENC_TYPE_URI%"", - encounter.encounterType_identifier))) + encounter_type = self._getCodedValueFromField(encounter, 'type', SPCODE["EncounterType"]) + g.add((eNode, SP['encounterType'], self.newCodedValue(encounter_type))) return eNode def medication(self, m): @@ -495,13 +415,9 @@ def medication(self, m): mNode = URIRef(m.uri()) g.add((mNode, RDF.type, SP['Medication'])) - g.add((mNode, SP['drugName'], - self.codedValue( - SPCODE["RxNorm_Semantic"], - RXN_URI%m.drugName_identifier, - m.drugName_title, - RXN_URI%"", - m.drugName_identifier))) + + drug_name = self._getCodedValueFromField(m, 'name', SPCODE["RxNorm_Semantic"]) + g.add((mNode, SP['drugName'], self.newCodedValue(drug_name))) g.add((mNode, SP['startDate'], Literal(m.startDate))) g.add((mNode, SP['instructions'], Literal(m.instructions or ''))) if m.quantity_value and m.quantity_unit: @@ -511,13 +427,65 @@ def medication(self, m): if m.endDate: g.add((mNode, SP['endDate'], Literal(m.endDate))) if m.provenance_identifier and m.provenance_title and m.provenance_system: + provenance = self._getCodeFromField(m, 'provenance', [SPCODE['MedicationProvenance']]) g.add((mNode, SP['provenance'], - self.code(m.provenance_title, - MED_PROV_URI%"", - m.provenance_identifier, - [SPCODE['MedicationProvenance']]))) + self.new_code(provenance))) return mNode + def newCodedValue(self, coded_value): + """ Adds a CodedValue to the graph and returns a node""" + + if not coded_value: + return None + + title = coded_value.get('title', '') + code = coded_value.get('code', None) + provenance = coded_value.get('provenance', None) + + cv_node = BNode() + + self.g.add((cv_node, RDF.type, SP['CodedValue'])) + self.g.add((cv_node, DCTERMS['title'], Literal(title))) + + # sp:code + code_node = self.new_code(code) + if code_node: + self.g.add((cv_node, SP['code'], code_node)) + + # sp:provenance + provenance_node = self.codeProvenance(provenance) + if provenance_node: + self.g.add((cv_node, SP['provenance'], provenance_node)) + + return cv_node + + + def new_code(self, code, blank=False): + """ Adds a Code to the graph and returns node """ + + if not code or (code.get("identifier") is None and code.get("title") is None and code.get("system") is None): + # don't add Codes that are empty + return None + + classes = code.get("classes", []) + title = code.get("title", "") + system = code.get("system", "") + identifier = code.get("identifier", "") + + if blank: + node = BNode() + else: + node = URIRef(system + identifier) + self.g.add((node, RDF.type, SP['Code'])) + self.g.add((node, DCTERMS['title'], Literal(title))) + self.g.add((node, SP['system'], Literal(system))) + self.g.add((node, DCTERMS['identifier'], Literal(identifier))) + + # Add additional types: the general "Code" and specific, e.g. "BloodPressureCode" + for c in classes: + self.g.add((node, RDF.type, c)) + return node + def code(self, title, system, identifier, blank=False, classes=[]): """ Adds a Code to the graph and returns node """ if blank: @@ -534,6 +502,22 @@ def code(self, title, system, identifier, blank=False, classes=[]): self.g.add((node, RDF.type, c)) return node + def codeProvenance(self, provenance): + """ Adds a CodeProvenance to the graph and returns node """ + + title = provenance.get("title", None) + source_code = provenance.get("sourceCode", None) + translation_fidelity = provenance.get("translationFidelity", None) + + node = BNode() + self.g.add((node, DCTERMS['title'], Literal(title))) + self.g.add((node, DCTERMS['sourceCode'], Literal(source_code))) + + translation_fidelity_node = self.new_code(translation_fidelity) + if translation_fidelity_node: + self.g.add((node, SPCODE['TranslationFidelity'], translation_fidelity_node)) + + def codedValue(self,codeclass,uri,title,system,identifier): """ Adds a CodedValue to the graph and returns node""" if not (codeclass or uri or title or system or identifier): return None @@ -826,3 +810,51 @@ def _obj_fields_by_name(self, obj, prefix, suffixes): def addStatement(self, s): self.g.add((s, SP['belongsTo'], URIRef(INDIVO_RECORD_URI%self.record.id))) + + + def _getCodedValueFromField(self, model, field_prefix, classes=None): + """ Build up a dictionary representing a sp:CodedValue """ + + coded_value = {} + + try: + coded_value["title"] = getattr(model, '%s_title' % (field_prefix)) + coded_value["code"] = self._getCodeFromField(model, "%s_code" % (field_prefix), classes) + coded_value["provenance"] = self._getProvenanceFromField(model, "%s_provenance" % (field_prefix)) + except AttributeError: + raise #TODO + + return coded_value + + def _getCodeFromField(self, model, field_prefix, classes=None): + """ Build up a dictionary representing a sp:code """ + + classes = classes or [] + code = {} + + try: + code["classes"] = classes + code["identifier"] = getattr(model, '%s_identifier' % (field_prefix)) + code["title"] = getattr(model, '%s_title' % (field_prefix)) + code["system"] = getattr(model, '%s_system' % (field_prefix)) + except AttributeError: + raise #TODO + + return code + + def _getProvenanceFromField(self, model, field_prefix): + """ Build up a dictionary representing a sp:provenance """ + + provenance = {} + + try: + provenance["title"] = getattr(model, '%s_title' % (field_prefix)) + provenance["sourceCode"] = getattr(model, '%s_source_code' % (field_prefix)) + translation_fidelity = self._getCodeFromField(model, "%s_translation_fidelity" % (field_prefix), classes=[SPCODE['TranslationFidelity']]) + provenance["translationFidelity"] = translation_fidelity + except AttributeError: + raise #TODO + + return provenance + + \ No newline at end of file diff --git a/indivo/migrations/0037_smart_05_changes.py b/indivo/migrations/0037_smart_05_changes.py new file mode 100644 index 00000000..74682d40 --- /dev/null +++ b/indivo/migrations/0037_smart_05_changes.py @@ -0,0 +1,2274 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + + # Adding field 'Encounter.type_provenance_source_code' + db.add_column('indivo_encounter', 'type_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='type_prov_sc', blank=True), keep_default=False) + + # Adding field 'Encounter.type_provenance_translation_fidelity_identifier' + db.add_column('indivo_encounter', 'type_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='type_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Encounter.type_provenance_translation_fidelity_system' + db.add_column('indivo_encounter', 'type_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='type_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Encounter.type_provenance_translation_fidelity_title' + db.add_column('indivo_encounter', 'type_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='type_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Encounter.type_provenance_title' + db.add_column('indivo_encounter', 'type_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='type_prov_title', blank=True), keep_default=False) + + + db.rename_column('indivo_encounter', 'encounterType_identifier', 'type_code_id') + db.rename_column('indivo_encounter', 'encounterType_system', 'type_code_sys') + db.rename_column('indivo_encounter', 'encounterType_title', 'type_code_title') + # Adding field 'Encounter.type_title' + db.add_column('indivo_encounter', 'type_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='type_title', blank=True), keep_default=False) + + + + # Deleting field 'Immunization.administration_status_system' + db.rename_column('indivo_immunization', 'administration_status_system', 'administration_status_code_sys') + db.rename_column('indivo_immunization', 'administration_status_identifier', 'administration_status_code_id') + db.rename_column('indivo_immunization', 'administration_status_title', 'administration_status_code_title') + db.add_column('indivo_immunization', 'administration_status_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + # Deleting field 'Immunization.product_class_identifier' + db.rename_column('indivo_immunization', 'product_class_identifier', 'product_class_code_id') + db.rename_column('indivo_immunization', 'product_class_system', 'product_class_code_sys') + db.rename_column('indivo_immunization', 'product_class_title', 'product_class_code_title') + db.add_column('indivo_immunization', 'product_class_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'Immunization.product_class_2_system' + db.rename_column('indivo_immunization', 'product_class_2_system', 'product_class_2_code_sys') + db.rename_column('indivo_immunization', 'product_class_2_identifier', 'product_class_2_code_id') + db.rename_column('indivo_immunization', 'product_class_2_title', 'product_class_2_code_title') + db.add_column('indivo_immunization', 'product_class_2_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'Immunization.product_name_identifier' + db.rename_column('indivo_immunization', 'product_name_identifier', 'product_name_code_id') + db.rename_column('indivo_immunization', 'product_name_system', 'product_name_code_sys') + db.rename_column('indivo_immunization', 'product_name_title', 'product_name_code_title') + db.add_column('indivo_immunization', 'product_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'Immunization.refusal_reason_system' + db.rename_column('indivo_immunization', 'refusal_reason_system', 'refusal_reason_code_sys') + db.rename_column('indivo_immunization', 'refusal_reason_identifier', 'refusal_reason_code_id') + db.rename_column('indivo_immunization', 'refusal_reason_title', 'refusal_reason_code_title') + db.add_column('indivo_immunization', 'refusal_reason_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + # Adding field 'Immunization.product_class_provenance_source_code' + db.add_column('indivo_immunization', 'product_class_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_class_prov_sc', blank=True), keep_default=False) + + # Adding field 'Immunization.product_class_provenance_translation_fidelity_identifier' + db.add_column('indivo_immunization', 'product_class_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_class_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Immunization.product_class_provenance_translation_fidelity_system' + db.add_column('indivo_immunization', 'product_class_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_class_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Immunization.product_class_provenance_translation_fidelity_title' + db.add_column('indivo_immunization', 'product_class_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_class_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Immunization.product_class_provenance_title' + db.add_column('indivo_immunization', 'product_class_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_class_prov_title', blank=True), keep_default=False) + + + + + # Adding field 'Immunization.product_class_2_provenance_source_code' + db.add_column('indivo_immunization', 'product_class_2_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_class_2_prov_sc', blank=True), keep_default=False) + + # Adding field 'Immunization.product_class_2_provenance_translation_fidelity_identifier' + db.add_column('indivo_immunization', 'product_class_2_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_class_2_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Immunization.product_class_2_provenance_translation_fidelity_system' + db.add_column('indivo_immunization', 'product_class_2_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_class_2_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Immunization.product_class_2_provenance_translation_fidelity_title' + db.add_column('indivo_immunization', 'product_class_2_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_class_2_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Immunization.product_class_2_provenance_title' + db.add_column('indivo_immunization', 'product_class_2_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_class_2_prov_title', blank=True), keep_default=False) + + + + + # Adding field 'Immunization.refusal_reason_provenance_source_code' + db.add_column('indivo_immunization', 'refusal_reason_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='refusal_reason_prov_sc', blank=True), keep_default=False) + + # Adding field 'Immunization.refusal_reason_provenance_translation_fidelity_identifier' + db.add_column('indivo_immunization', 'refusal_reason_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='refusal_reason_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Immunization.refusal_reason_provenance_translation_fidelity_system' + db.add_column('indivo_immunization', 'refusal_reason_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='refusal_reason_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Immunization.refusal_reason_provenance_translation_fidelity_title' + db.add_column('indivo_immunization', 'refusal_reason_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='refusal_reason_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Immunization.refusal_reason_provenance_title' + db.add_column('indivo_immunization', 'refusal_reason_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='refusal_reason_prov_title', blank=True), keep_default=False) + + + + + # Adding field 'Immunization.administration_status_provenance_source_code' + db.add_column('indivo_immunization', 'administration_status_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='administration_status_prov_sc', blank=True), keep_default=False) + + # Adding field 'Immunization.administration_status_provenance_translation_fidelity_identifier' + db.add_column('indivo_immunization', 'administration_status_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='administration_status_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Immunization.administration_status_provenance_translation_fidelity_system' + db.add_column('indivo_immunization', 'administration_status_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='administration_status_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Immunization.administration_status_provenance_translation_fidelity_title' + db.add_column('indivo_immunization', 'administration_status_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='administration_status_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Immunization.administration_status_provenance_title' + db.add_column('indivo_immunization', 'administration_status_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='administration_status_prov_title', blank=True), keep_default=False) + + + + + # Adding field 'Immunization.product_name_provenance_source_code' + db.add_column('indivo_immunization', 'product_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'Immunization.product_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_immunization', 'product_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Immunization.product_name_provenance_translation_fidelity_system' + db.add_column('indivo_immunization', 'product_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Immunization.product_name_provenance_translation_fidelity_title' + db.add_column('indivo_immunization', 'product_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Immunization.product_name_provenance_title' + db.add_column('indivo_immunization', 'product_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='product_name_prov_title', blank=True), keep_default=False) + + + + + + db.rename_column('indivo_problem', 'name_identifier', 'name_code_id') + db.rename_column('indivo_problem', 'name_system', 'name_code_sys') + db.rename_column('indivo_problem', 'name_title', 'name_code_title') + db.add_column('indivo_problem', 'name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + # Adding field 'Problem.name_provenance_source_code' + db.add_column('indivo_problem', 'name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_sc', blank=True), keep_default=False) + + # Adding field 'Problem.name_provenance_translation_fidelity_identifier' + db.add_column('indivo_problem', 'name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Problem.name_provenance_translation_fidelity_system' + db.add_column('indivo_problem', 'name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Problem.name_provenance_translation_fidelity_title' + db.add_column('indivo_problem', 'name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Problem.name_provenance_title' + db.add_column('indivo_problem', 'name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_title', blank=True), keep_default=False) + + + + # Deleting field 'VitalSigns.heart_rate_name_system' + db.rename_column('indivo_vitalsigns', 'heart_rate_name_identifier', 'heart_rate_name_code_id') + db.rename_column('indivo_vitalsigns', 'heart_rate_name_system', 'heart_rate_name_code_sys') + db.rename_column('indivo_vitalsigns', 'heart_rate_name_title', 'heart_rate_name_code_title') + db.add_column('indivo_vitalsigns', 'heart_rate_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'VitalSigns.oxygen_saturation_name_system' + db.rename_column('indivo_vitalsigns', 'oxygen_saturation_name_identifier', 'oxygen_saturation_name_code_id') + db.rename_column('indivo_vitalsigns', 'oxygen_saturation_name_system', 'oxygen_saturation_name_code_sys') + db.rename_column('indivo_vitalsigns', 'oxygen_saturation_name_title', 'oxygen_saturation_name_code_title') + db.add_column('indivo_vitalsigns', 'oxygen_saturation_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'VitalSigns.temperature_name_system' + db.rename_column('indivo_vitalsigns', 'temperature_name_identifier', 'temperature_name_code_id') + db.rename_column('indivo_vitalsigns', 'temperature_name_system', 'temperature_name_code_sys') + db.rename_column('indivo_vitalsigns', 'temperature_name_title', 'temperature_name_code_title') + db.add_column('indivo_vitalsigns', 'temperature_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'VitalSigns.bp_systolic_name_system' + db.rename_column('indivo_vitalsigns', 'bp_systolic_name_identifier', 'bp_systolic_name_code_id') + db.rename_column('indivo_vitalsigns', 'bp_systolic_name_system', 'bp_systolic_name_code_sys') + db.rename_column('indivo_vitalsigns', 'bp_systolic_name_title', 'bp_systolic_name_code_title') + db.add_column('indivo_vitalsigns', 'bp_systolic_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'VitalSigns.bp_diastolic_name_identifier' + db.rename_column('indivo_vitalsigns', 'bp_diastolic_name_identifier', 'bp_diastolic_name_code_id') + db.rename_column('indivo_vitalsigns', 'bp_diastolic_name_system', 'bp_diastolic_name_code_sys') + db.rename_column('indivo_vitalsigns', 'bp_diastolic_name_title', 'bp_diastolic_name_code_title') + db.add_column('indivo_vitalsigns', 'bp_diastolic_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'VitalSigns.height_name_system' + db.rename_column('indivo_vitalsigns', 'height_name_identifier', 'height_name_code_id') + db.rename_column('indivo_vitalsigns', 'height_name_system', 'height_name_code_sys') + db.rename_column('indivo_vitalsigns', 'height_name_title', 'height_name_code_title') + db.add_column('indivo_vitalsigns', 'height_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'VitalSigns.bmi_name_system' + db.rename_column('indivo_vitalsigns', 'bmi_name_identifier', 'bmi_name_code_id') + db.rename_column('indivo_vitalsigns', 'bmi_name_system', 'bmi_name_code_sys') + db.rename_column('indivo_vitalsigns', 'bmi_name_title', 'bmi_name_code_title') + db.add_column('indivo_vitalsigns', 'bmi_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + # Deleting field 'VitalSigns.respiratory_rate_name_identifier' + db.rename_column('indivo_vitalsigns', 'respiratory_rate_name_identifier', 'respiratory_rate_name_code_id') + db.rename_column('indivo_vitalsigns', 'respiratory_rate_name_system', 'respiratory_rate_name_code_sys') + db.rename_column('indivo_vitalsigns', 'respiratory_rate_name_title', 'respiratory_rate_name_code_title') + db.add_column('indivo_vitalsigns', 'respiratory_rate_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'VitalSigns.bp_position_identifier' + db.rename_column('indivo_vitalsigns', 'bp_position_identifier', 'bp_position_code_id') + db.rename_column('indivo_vitalsigns', 'bp_position_system', 'bp_position_code_sys') + db.rename_column('indivo_vitalsigns', 'bp_position_title', 'bp_position_code_title') + db.add_column('indivo_vitalsigns', 'bp_position_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'VitalSigns.bp_method_identifier' + db.rename_column('indivo_vitalsigns', 'bp_method_identifier', 'bp_method_code_id') + db.rename_column('indivo_vitalsigns', 'bp_method_system', 'bp_method_code_sys') + db.rename_column('indivo_vitalsigns', 'bp_method_title', 'bp_method_code_title') + db.add_column('indivo_vitalsigns', 'bp_method_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + db.rename_column('indivo_vitalsigns', 'bp_site_identifier', 'bp_site_code_id') + db.rename_column('indivo_vitalsigns', 'bp_site_system', 'bp_site_code_sys') + db.rename_column('indivo_vitalsigns', 'bp_site_title', 'bp_site_code_title') + db.add_column('indivo_vitalsigns', 'bp_site_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Deleting field 'VitalSigns.weight_name_system' + db.rename_column('indivo_vitalsigns', 'weight_name_identifier', 'weight_name_code_id') + db.rename_column('indivo_vitalsigns', 'weight_name_system', 'weight_name_code_sys') + db.rename_column('indivo_vitalsigns', 'weight_name_title', 'weight_name_code_title') + db.add_column('indivo_vitalsigns', 'weight_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + # Adding field 'VitalSigns.temperature_name_provenance_source_code' + db.add_column('indivo_vitalsigns', 'temperature_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='temperature_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.temperature_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'temperature_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='temperature_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.temperature_name_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'temperature_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='temperature_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.temperature_name_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'temperature_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='temperature_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.temperature_name_provenance_title' + db.add_column('indivo_vitalsigns', 'temperature_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='temperature_name_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.weight_name_provenance_source_code' + db.add_column('indivo_vitalsigns', 'weight_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='weight_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.weight_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'weight_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='weight_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.weight_name_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'weight_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='weight_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.weight_name_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'weight_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='weight_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.weight_name_provenance_title' + db.add_column('indivo_vitalsigns', 'weight_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='weight_name_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.oxygen_saturation_name_provenance_source_code' + db.add_column('indivo_vitalsigns', 'oxygen_saturation_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='oxygen_saturation_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.oxygen_saturation_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'oxygen_saturation_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='oxygen_saturation_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.oxygen_saturation_name_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'oxygen_saturation_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='oxygen_saturation_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.oxygen_saturation_name_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'oxygen_saturation_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='oxygen_saturation_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.oxygen_saturation_name_provenance_title' + db.add_column('indivo_vitalsigns', 'oxygen_saturation_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='oxygen_saturation_name_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.bmi_name_provenance_source_code' + db.add_column('indivo_vitalsigns', 'bmi_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bmi_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bmi_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'bmi_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bmi_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bmi_name_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'bmi_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bmi_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bmi_name_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'bmi_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bmi_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bmi_name_provenance_title' + db.add_column('indivo_vitalsigns', 'bmi_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bmi_name_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.respiratory_rate_name_provenance_source_code' + db.add_column('indivo_vitalsigns', 'respiratory_rate_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='respiratory_rate_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.respiratory_rate_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'respiratory_rate_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='respiratory_rate_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.respiratory_rate_name_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'respiratory_rate_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='respiratory_rate_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.respiratory_rate_name_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'respiratory_rate_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='respiratory_rate_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.respiratory_rate_name_provenance_title' + db.add_column('indivo_vitalsigns', 'respiratory_rate_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='respiratory_rate_name_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.height_name_provenance_source_code' + db.add_column('indivo_vitalsigns', 'height_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='height_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.height_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'height_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='height_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.height_name_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'height_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='height_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.height_name_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'height_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='height_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.height_name_provenance_title' + db.add_column('indivo_vitalsigns', 'height_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='height_name_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.heart_rate_name_provenance_source_code' + db.add_column('indivo_vitalsigns', 'heart_rate_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='heart_rate_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.heart_rate_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'heart_rate_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='heart_rate_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.heart_rate_name_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'heart_rate_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='heart_rate_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.heart_rate_name_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'heart_rate_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='heart_rate_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.heart_rate_name_provenance_title' + db.add_column('indivo_vitalsigns', 'heart_rate_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='heart_rate_name_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.bp_position_provenance_source_code' + db.add_column('indivo_vitalsigns', 'bp_position_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_position_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_position_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'bp_position_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_position_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_position_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'bp_position_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_position_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_position_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'bp_position_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_position_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_position_provenance_title' + db.add_column('indivo_vitalsigns', 'bp_position_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_position_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.bp_diastolic_name_provenance_source_code' + db.add_column('indivo_vitalsigns', 'bp_diastolic_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_diastolic_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_diastolic_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'bp_diastolic_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_diastolic_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_diastolic_name_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'bp_diastolic_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_diastolic_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_diastolic_name_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'bp_diastolic_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_diastolic_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_diastolic_name_provenance_title' + db.add_column('indivo_vitalsigns', 'bp_diastolic_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_diastolic_name_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.bp_systolic_name_provenance_source_code' + db.add_column('indivo_vitalsigns', 'bp_systolic_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_systolic_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_systolic_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'bp_systolic_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_systolic_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_systolic_name_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'bp_systolic_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_systolic_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_systolic_name_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'bp_systolic_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_systolic_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_systolic_name_provenance_title' + db.add_column('indivo_vitalsigns', 'bp_systolic_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_systolic_name_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.bp_site_provenance_source_code' + db.add_column('indivo_vitalsigns', 'bp_site_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_site_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_site_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'bp_site_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_site_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_site_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'bp_site_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_site_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_site_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'bp_site_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_site_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_site_provenance_title' + db.add_column('indivo_vitalsigns', 'bp_site_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_site_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.bp_method_provenance_source_code' + db.add_column('indivo_vitalsigns', 'bp_method_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_method_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_method_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'bp_method_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_method_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_method_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'bp_method_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_method_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_method_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'bp_method_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_method_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.bp_method_provenance_title' + db.add_column('indivo_vitalsigns', 'bp_method_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='bp_method_prov_title', blank=True), keep_default=False) + + + # Adding field 'VitalSigns.head_circ_value' + db.add_column('indivo_vitalsigns', 'head_circ_value', self.gf('django.db.models.fields.FloatField')(null=True, db_column='head_circ_value', blank=True), keep_default=False) + + # Adding field 'VitalSigns.head_circ_unit' + db.add_column('indivo_vitalsigns', 'head_circ_unit', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='head_circ_unit', blank=True), keep_default=False) + + # Adding field 'VitalSigns.head_circ_name_provenance_source_code' + db.add_column('indivo_vitalsigns', 'head_circ_name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='head_circ_name_prov_sc', blank=True), keep_default=False) + + # Adding field 'VitalSigns.head_circ_name_provenance_translation_fidelity_identifier' + db.add_column('indivo_vitalsigns', 'head_circ_name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='head_circ_name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.head_circ_name_provenance_translation_fidelity_system' + db.add_column('indivo_vitalsigns', 'head_circ_name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='head_circ_name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.head_circ_name_provenance_translation_fidelity_title' + db.add_column('indivo_vitalsigns', 'head_circ_name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='head_circ_name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.head_circ_name_provenance_title' + db.add_column('indivo_vitalsigns', 'head_circ_name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='head_circ_name_prov_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.head_circ_name_code_id' + db.add_column('indivo_vitalsigns', 'head_circ_name_code_id', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='head_circ_name_code_id', blank=True), keep_default=False) + + # Adding field 'VitalSigns.head_circ_name_code_sys' + db.add_column('indivo_vitalsigns', 'head_circ_name_code_sys', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='head_circ_name_code_sys', blank=True), keep_default=False) + + # Adding field 'VitalSigns.head_circ_name_code_title' + db.add_column('indivo_vitalsigns', 'head_circ_name_code_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='head_circ_name_code_title', blank=True), keep_default=False) + + # Adding field 'VitalSigns.head_circ_name_title' + db.add_column('indivo_vitalsigns', 'head_circ_name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='head_circ_name_title', blank=True), keep_default=False) + + + + db.rename_column('indivo_allergy', 'drug_class_allergen_identifier', 'drug_class_allergen_code_id') + db.rename_column('indivo_allergy', 'drug_class_allergen_system', 'drug_class_allergen_code_sys') + db.rename_column('indivo_allergy', 'drug_class_allergen_title', 'drug_class_allergen_code_title') + db.add_column('indivo_allergy', 'drug_class_allergen_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + db.rename_column('indivo_allergy', 'category_identifier', 'category_code_id') + db.rename_column('indivo_allergy', 'category_system', 'category_code_sys') + db.rename_column('indivo_allergy', 'category_title', 'category_code_title') + db.add_column('indivo_allergy', 'category_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + db.rename_column('indivo_allergy', 'severity_identifier', 'severity_code_id') + db.rename_column('indivo_allergy', 'severity_system', 'severity_code_sys') + db.rename_column('indivo_allergy', 'severity_title', 'severity_code_title') + db.add_column('indivo_allergy', 'severity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + + db.rename_column('indivo_allergy', 'allergic_reaction_identifier', 'allergic_reaction_code_id') + db.rename_column('indivo_allergy', 'allergic_reaction_system', 'allergic_reaction_code_sys') + db.rename_column('indivo_allergy', 'allergic_reaction_title', 'allergic_reaction_code_title') + db.add_column('indivo_allergy', 'allergic_reaction_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + + db.rename_column('indivo_allergy', 'drug_allergen_identifier', 'drug_allergen_code_id') + db.rename_column('indivo_allergy', 'drug_allergen_system', 'drug_allergen_code_sys') + db.rename_column('indivo_allergy', 'drug_allergen_title', 'drug_allergen_code_title') + db.add_column('indivo_allergy', 'drug_allergen_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + + db.rename_column('indivo_allergy', 'food_allergen_identifier', 'other_allergen_code_id') + db.rename_column('indivo_allergy', 'food_allergen_system', 'other_allergen_code_sys') + db.rename_column('indivo_allergy', 'food_allergen_title', 'other_allergen_code_title') + db.add_column('indivo_allergy', 'other_allergen_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + + # Adding field 'Allergy.category_provenance_source_code' + db.add_column('indivo_allergy', 'category_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='category_prov_sc', blank=True), keep_default=False) + + # Adding field 'Allergy.category_provenance_translation_fidelity_identifier' + db.add_column('indivo_allergy', 'category_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='category_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Allergy.category_provenance_translation_fidelity_system' + db.add_column('indivo_allergy', 'category_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='category_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Allergy.category_provenance_translation_fidelity_title' + db.add_column('indivo_allergy', 'category_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='category_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Allergy.category_provenance_title' + db.add_column('indivo_allergy', 'category_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='category_prov_title', blank=True), keep_default=False) + + # Adding field 'Allergy.severity_provenance_source_code' + db.add_column('indivo_allergy', 'severity_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='severity_prov_sc', blank=True), keep_default=False) + + # Adding field 'Allergy.severity_provenance_translation_fidelity_identifier' + db.add_column('indivo_allergy', 'severity_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='severity_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Allergy.severity_provenance_translation_fidelity_system' + db.add_column('indivo_allergy', 'severity_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='severity_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Allergy.severity_provenance_translation_fidelity_title' + db.add_column('indivo_allergy', 'severity_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='severity_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Allergy.severity_provenance_title' + db.add_column('indivo_allergy', 'severity_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='severity_prov_title', blank=True), keep_default=False) + + # Adding field 'Allergy.drug_allergen_provenance_source_code' + db.add_column('indivo_allergy', 'drug_allergen_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='drug_allergen_prov_sc', blank=True), keep_default=False) + + # Adding field 'Allergy.drug_allergen_provenance_translation_fidelity_identifier' + db.add_column('indivo_allergy', 'drug_allergen_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='drug_allergen_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Allergy.drug_allergen_provenance_translation_fidelity_system' + db.add_column('indivo_allergy', 'drug_allergen_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='drug_allergen_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Allergy.drug_allergen_provenance_translation_fidelity_title' + db.add_column('indivo_allergy', 'drug_allergen_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='drug_allergen_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Allergy.drug_allergen_provenance_title' + db.add_column('indivo_allergy', 'drug_allergen_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='drug_allergen_prov_title', blank=True), keep_default=False) + + + # Adding field 'Allergy.drug_class_allergen_provenance_source_code' + db.add_column('indivo_allergy', 'drug_class_allergen_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='drug_class_allergen_prov_sc', blank=True), keep_default=False) + + # Adding field 'Allergy.drug_class_allergen_provenance_translation_fidelity_identifier' + db.add_column('indivo_allergy', 'drug_class_allergen_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='drug_class_allergen_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Allergy.drug_class_allergen_provenance_translation_fidelity_system' + db.add_column('indivo_allergy', 'drug_class_allergen_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='drug_class_allergen_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Allergy.drug_class_allergen_provenance_translation_fidelity_title' + db.add_column('indivo_allergy', 'drug_class_allergen_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='drug_class_allergen_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Allergy.drug_class_allergen_provenance_title' + db.add_column('indivo_allergy', 'drug_class_allergen_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='drug_class_allergen_prov_title', blank=True), keep_default=False) + + + + # Adding field 'Allergy.other_allergen_provenance_source_code' + db.add_column('indivo_allergy', 'other_allergen_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='other_allergen_prov_sc', blank=True), keep_default=False) + + # Adding field 'Allergy.other_allergen_provenance_translation_fidelity_identifier' + db.add_column('indivo_allergy', 'other_allergen_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='other_allergen_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Allergy.other_allergen_provenance_translation_fidelity_system' + db.add_column('indivo_allergy', 'other_allergen_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='other_allergen_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Allergy.other_allergen_provenance_translation_fidelity_title' + db.add_column('indivo_allergy', 'other_allergen_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='other_allergen_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Allergy.other_allergen_provenance_title' + db.add_column('indivo_allergy', 'other_allergen_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='other_allergen_prov_title', blank=True), keep_default=False) + + + # Adding field 'Allergy.allergic_reaction_provenance_source_code' + db.add_column('indivo_allergy', 'allergic_reaction_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='allergic_reaction_prov_sc', blank=True), keep_default=False) + + # Adding field 'Allergy.allergic_reaction_provenance_translation_fidelity_identifier' + db.add_column('indivo_allergy', 'allergic_reaction_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='allergic_reaction_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Allergy.allergic_reaction_provenance_translation_fidelity_system' + db.add_column('indivo_allergy', 'allergic_reaction_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='allergic_reaction_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Allergy.allergic_reaction_provenance_translation_fidelity_title' + db.add_column('indivo_allergy', 'allergic_reaction_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='allergic_reaction_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Allergy.allergic_reaction_provenance_title' + db.add_column('indivo_allergy', 'allergic_reaction_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='allergic_reaction_prov_title', blank=True), keep_default=False) + + + + # Deleting field 'Procedure.date_performed' + db.delete_column('indivo_procedure', 'date_performed') + + # Deleting field 'Procedure.name_value' + db.delete_column('indivo_procedure', 'name_value') + + # Deleting field 'Procedure.name_abbrev' + db.delete_column('indivo_procedure', 'name_abbrev') + + # Deleting field 'Procedure.name' + db.delete_column('indivo_procedure', 'name') + + # Deleting field 'Procedure.comments' + db.delete_column('indivo_procedure', 'comments') + + # Deleting field 'Procedure.provider_institution' + db.delete_column('indivo_procedure', 'provider_institution') + + # Deleting field 'Procedure.location' + db.delete_column('indivo_procedure', 'location') + + # Deleting field 'Procedure.provider_name' + db.delete_column('indivo_procedure', 'provider_name') + + # Deleting field 'Procedure.name_type' + db.delete_column('indivo_procedure', 'name_type') + + # Adding field 'Procedure.date' + db.add_column('indivo_procedure', 'date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), keep_default=False) + + # Adding field 'Procedure.notes' + db.add_column('indivo_procedure', 'notes', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) + + # Adding field 'Procedure.status_provenance_source_code' + db.add_column('indivo_procedure', 'status_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_prov_sc', blank=True), keep_default=False) + + # Adding field 'Procedure.status_provenance_translation_fidelity_identifier' + db.add_column('indivo_procedure', 'status_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Procedure.status_provenance_translation_fidelity_system' + db.add_column('indivo_procedure', 'status_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Procedure.status_provenance_translation_fidelity_title' + db.add_column('indivo_procedure', 'status_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Procedure.status_provenance_title' + db.add_column('indivo_procedure', 'status_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_prov_title', blank=True), keep_default=False) + + # Adding field 'Procedure.status_code_id' + db.add_column('indivo_procedure', 'status_code_id', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_code_id', blank=True), keep_default=False) + + # Adding field 'Procedure.status_code_sys' + db.add_column('indivo_procedure', 'status_code_sys', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_code_sys', blank=True), keep_default=False) + + # Adding field 'Procedure.status_code_title' + db.add_column('indivo_procedure', 'status_code_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_code_title', blank=True), keep_default=False) + + # Adding field 'Procedure.status_title' + db.add_column('indivo_procedure', 'status_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_title', blank=True), keep_default=False) + + # Adding field 'Procedure.name_provenance_source_code' + db.add_column('indivo_procedure', 'name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_sc', blank=True), keep_default=False) + + # Adding field 'Procedure.name_provenance_translation_fidelity_identifier' + db.add_column('indivo_procedure', 'name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Procedure.name_provenance_translation_fidelity_system' + db.add_column('indivo_procedure', 'name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Procedure.name_provenance_translation_fidelity_title' + db.add_column('indivo_procedure', 'name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Procedure.name_provenance_title' + db.add_column('indivo_procedure', 'name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_title', blank=True), keep_default=False) + + # Adding field 'Procedure.name_code_id' + db.add_column('indivo_procedure', 'name_code_id', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_code_id', blank=True), keep_default=False) + + # Adding field 'Procedure.name_code_sys' + db.add_column('indivo_procedure', 'name_code_sys', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_code_sys', blank=True), keep_default=False) + + # Adding field 'Procedure.name_code_title' + db.add_column('indivo_procedure', 'name_code_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_code_title', blank=True), keep_default=False) + + # Adding field 'Procedure.name_title' + db.add_column('indivo_procedure', 'name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_title', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_bday' + db.add_column('indivo_procedure', 'provider_bday', self.gf('django.db.models.fields.DateField')(null=True, db_column='provider_bday', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_dea_number' + db.add_column('indivo_procedure', 'provider_dea_number', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_dea_number', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_ethnicity' + db.add_column('indivo_procedure', 'provider_ethnicity', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_ethnicity', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_npi_number' + db.add_column('indivo_procedure', 'provider_npi_number', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_npi_number', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_adr_postalcode' + db.add_column('indivo_procedure', 'provider_adr_postalcode', self.gf('django.db.models.fields.CharField')(max_length=12, null=True, db_column='provider_adr_postalcode', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_adr_country' + db.add_column('indivo_procedure', 'provider_adr_country', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_adr_country', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_adr_region' + db.add_column('indivo_procedure', 'provider_adr_region', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_adr_region', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_adr_street' + db.add_column('indivo_procedure', 'provider_adr_street', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_adr_street', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_adr_city' + db.add_column('indivo_procedure', 'provider_adr_city', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_adr_city', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_name_middle' + db.add_column('indivo_procedure', 'provider_name_middle', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_name_middle', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_name_given' + db.add_column('indivo_procedure', 'provider_name_given', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_name_given', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_name_prefix' + db.add_column('indivo_procedure', 'provider_name_prefix', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_name_prefix', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_name_family' + db.add_column('indivo_procedure', 'provider_name_family', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_name_family', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_name_suffix' + db.add_column('indivo_procedure', 'provider_name_suffix', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_name_suffix', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_preferred_language' + db.add_column('indivo_procedure', 'provider_preferred_language', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_preferred_language', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_tel_2_type' + db.add_column('indivo_procedure', 'provider_tel_2_type', self.gf('django.db.models.fields.CharField')(max_length=1, null=True, db_column='provider_tel_2_type', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_tel_2_number' + db.add_column('indivo_procedure', 'provider_tel_2_number', self.gf('django.db.models.fields.CharField')(max_length=20, null=True, db_column='provider_tel_2_number', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_tel_2_preferred_p' + db.add_column('indivo_procedure', 'provider_tel_2_preferred_p', self.gf('django.db.models.fields.BooleanField')(default=False, db_column='provider_tel_2_preferred_p'), keep_default=False) + + # Adding field 'Procedure.provider_tel_1_type' + db.add_column('indivo_procedure', 'provider_tel_1_type', self.gf('django.db.models.fields.CharField')(max_length=1, null=True, db_column='provider_tel_1_type', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_tel_1_number' + db.add_column('indivo_procedure', 'provider_tel_1_number', self.gf('django.db.models.fields.CharField')(max_length=20, null=True, db_column='provider_tel_1_number', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_tel_1_preferred_p' + db.add_column('indivo_procedure', 'provider_tel_1_preferred_p', self.gf('django.db.models.fields.BooleanField')(default=False, db_column='provider_tel_1_preferred_p'), keep_default=False) + + # Adding field 'Procedure.provider_race' + db.add_column('indivo_procedure', 'provider_race', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_race', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_gender' + db.add_column('indivo_procedure', 'provider_gender', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provider_gender', blank=True), keep_default=False) + + # Adding field 'Procedure.provider_email' + db.add_column('indivo_procedure', 'provider_email', self.gf('django.db.models.fields.EmailField')(max_length=255, null=True, db_column='provider_email', blank=True), keep_default=False) + + + db.rename_column('indivo_allergyexclusion', 'name_identifier', 'name_code_id') + db.rename_column('indivo_allergyexclusion', 'name_system', 'name_code_sys') + db.rename_column('indivo_allergyexclusion', 'name_title', 'name_code_title') + db.add_column('indivo_allergyexclusion', 'name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + # Adding field 'AllergyExclusion.name_provenance_source_code' + db.add_column('indivo_allergyexclusion', 'name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_sc', blank=True), keep_default=False) + + # Adding field 'AllergyExclusion.name_provenance_translation_fidelity_identifier' + db.add_column('indivo_allergyexclusion', 'name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'AllergyExclusion.name_provenance_translation_fidelity_system' + db.add_column('indivo_allergyexclusion', 'name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'AllergyExclusion.name_provenance_translation_fidelity_title' + db.add_column('indivo_allergyexclusion', 'name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'AllergyExclusion.name_provenance_title' + db.add_column('indivo_allergyexclusion', 'name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_title', blank=True), keep_default=False) + + + + db.rename_column('indivo_medication', 'drugName_identifier', 'name_code_id') + db.rename_column('indivo_medication', 'drugName_system', 'name_code_sys') + db.rename_column('indivo_medication', 'drugName_title', 'name_code_title') + db.add_column('indivo_medication', 'name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + db.rename_column('indivo_medication', 'provenance_identifier', 'provenance_code_id') + db.rename_column('indivo_medication', 'provenance_system', 'provenance_code_sys') + db.rename_column('indivo_medication', 'provenance_title', 'provenance_code_title') + db.add_column('indivo_medication', 'provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + # Adding field 'Medication.name_provenance_source_code' + db.add_column('indivo_medication', 'name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_sc', blank=True), keep_default=False) + + # Adding field 'Medication.name_provenance_translation_fidelity_identifier' + db.add_column('indivo_medication', 'name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Medication.name_provenance_translation_fidelity_system' + db.add_column('indivo_medication', 'name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Medication.name_provenance_translation_fidelity_title' + db.add_column('indivo_medication', 'name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Medication.name_provenance_title' + db.add_column('indivo_medication', 'name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_title', blank=True), keep_default=False) + + + + # Adding field 'Medication.provenance_provenance_source_code' + db.add_column('indivo_medication', 'provenance_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provenance_prov_sc', blank=True), keep_default=False) + + # Adding field 'Medication.provenance_provenance_translation_fidelity_identifier' + db.add_column('indivo_medication', 'provenance_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provenance_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'Medication.provenance_provenance_translation_fidelity_system' + db.add_column('indivo_medication', 'provenance_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provenance_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'Medication.provenance_provenance_translation_fidelity_title' + db.add_column('indivo_medication', 'provenance_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provenance_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'Medication.provenance_provenance_title' + db.add_column('indivo_medication', 'provenance_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='provenance_prov_title', blank=True), keep_default=False) + + + # Deleting field 'LabResult.collected_by_org_adr_country' + db.delete_column('indivo_labresult', 'collected_by_org_adr_country') + + # Deleting field 'LabResult.collected_by_name_suffix' + db.delete_column('indivo_labresult', 'collected_by_name_suffix') + + # Deleting field 'LabResult.collected_by_org_adr_city' + db.delete_column('indivo_labresult', 'collected_by_org_adr_city') + + # Deleting field 'LabResult.collected_by_name_given' + db.delete_column('indivo_labresult', 'collected_by_name_given') + + # Deleting field 'LabResult.collected_by_role' + db.delete_column('indivo_labresult', 'collected_by_role') + + # Deleting field 'LabResult.collected_by_org_adr_region' + db.delete_column('indivo_labresult', 'collected_by_org_adr_region') + + # Deleting field 'LabResult.collected_by_org_name' + db.delete_column('indivo_labresult', 'collected_by_org_name') + + # Deleting field 'LabResult.collected_by_org_adr_postalcode' + db.delete_column('indivo_labresult', 'collected_by_org_adr_postalcode') + + # Deleting field 'LabResult.collected_by_name_prefix' + db.delete_column('indivo_labresult', 'collected_by_name_prefix') + + # Deleting field 'LabResult.collected_by_org_adr_street' + db.delete_column('indivo_labresult', 'collected_by_org_adr_street') + + # Deleting field 'LabResult.collected_by_name_family' + db.delete_column('indivo_labresult', 'collected_by_name_family') + + # Deleting field 'LabResult.collected_by_name_middle' + db.delete_column('indivo_labresult', 'collected_by_name_middle') + + + db.rename_column('indivo_labresult', 'test_name_identifier', 'name_code_id') + db.rename_column('indivo_labresult', 'test_name_system', 'name_code_sys') + db.rename_column('indivo_labresult', 'test_name_title', 'name_code_title') + db.add_column('indivo_labresult', 'name_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + db.rename_column('indivo_labresult', 'abnormal_interpretation_identifier', 'abnormal_interpretation_code_id') + db.rename_column('indivo_labresult', 'abnormal_interpretation_system', 'abnormal_interpretation_code_sys') + db.rename_column('indivo_labresult', 'abnormal_interpretation_title', 'abnormal_interpretation_code_title') + db.add_column('indivo_labresult', 'abnormal_interpretation_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + db.rename_column('indivo_labresult', 'status_identifier', 'status_code_id') + db.rename_column('indivo_labresult', 'status_system', 'status_code_sys') + db.rename_column('indivo_labresult', 'status_title', 'status_code_title') + db.add_column('indivo_labresult', 'status_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + + db.rename_column('indivo_labresult', 'collected_at', 'date') + + # Adding field 'LabResult.status_provenance_source_code' + db.add_column('indivo_labresult', 'status_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_prov_sc', blank=True), keep_default=False) + + # Adding field 'LabResult.status_provenance_translation_fidelity_identifier' + db.add_column('indivo_labresult', 'status_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'LabResult.status_provenance_translation_fidelity_system' + db.add_column('indivo_labresult', 'status_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'LabResult.status_provenance_translation_fidelity_title' + db.add_column('indivo_labresult', 'status_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'LabResult.status_provenance_title' + db.add_column('indivo_labresult', 'status_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='status_prov_title', blank=True), keep_default=False) + + + # Adding field 'LabResult.name_provenance_source_code' + db.add_column('indivo_labresult', 'name_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_sc', blank=True), keep_default=False) + + # Adding field 'LabResult.name_provenance_translation_fidelity_identifier' + db.add_column('indivo_labresult', 'name_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'LabResult.name_provenance_translation_fidelity_system' + db.add_column('indivo_labresult', 'name_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'LabResult.name_provenance_translation_fidelity_title' + db.add_column('indivo_labresult', 'name_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'LabResult.name_provenance_title' + db.add_column('indivo_labresult', 'name_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='name_prov_title', blank=True), keep_default=False) + + + + # Adding field 'LabResult.abnormal_interpretation_provenance_source_code' + db.add_column('indivo_labresult', 'abnormal_interpretation_provenance_source_code', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='abnormal_interpretation_prov_sc', blank=True), keep_default=False) + + # Adding field 'LabResult.abnormal_interpretation_provenance_translation_fidelity_identifier' + db.add_column('indivo_labresult', 'abnormal_interpretation_provenance_translation_fidelity_identifier', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='abnormal_interpretation_prov_tf_id', blank=True), keep_default=False) + + # Adding field 'LabResult.abnormal_interpretation_provenance_translation_fidelity_system' + db.add_column('indivo_labresult', 'abnormal_interpretation_provenance_translation_fidelity_system', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='abnormal_interpretation_prov_tf_sys', blank=True), keep_default=False) + + # Adding field 'LabResult.abnormal_interpretation_provenance_translation_fidelity_title' + db.add_column('indivo_labresult', 'abnormal_interpretation_provenance_translation_fidelity_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='abnormal_interpretation_prov_tf_title', blank=True), keep_default=False) + + # Adding field 'LabResult.abnormal_interpretation_provenance_title' + db.add_column('indivo_labresult', 'abnormal_interpretation_provenance_title', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, db_column='abnormal_interpretation_prov_title', blank=True), keep_default=False) + + + + + def backwards(self, orm): + + db.delete_column('indivo_encounter', 'type_prov_sc') + db.delete_column('indivo_encounter', 'type_prov_tf_id') + db.delete_column('indivo_encounter', 'type_prov_tf_sys') + db.delete_column('indivo_encounter', 'type_prov_tf_title') + db.delete_column('indivo_encounter', 'type_prov_title') + db.rename_column('indivo_encounter', 'type_code_id', 'encounterType_identifier') + db.rename_column('indivo_encounter', 'type_code_sys', 'encounterType_system') + db.rename_column('indivo_encounter', 'type_code_title', 'encounterType_title') + db.delete_column('indivo_encounter', 'type_title') + + db.delete_column('indivo_immunization', 'administration_status_title') + db.rename_column('indivo_immunization', 'administration_status_code_sys', 'administration_status_system') + db.rename_column('indivo_immunization', 'administration_status_code_id', 'administration_status_identifier') + db.rename_column('indivo_immunization', 'administration_status_code_title', 'administration_status_title') + + db.delete_column('indivo_immunization', 'product_class_title') + db.rename_column('indivo_immunization', 'product_class_code_id', 'product_class_identifier') + db.rename_column('indivo_immunization', 'product_class_code_sys', 'product_class_system') + db.rename_column('indivo_immunization', 'product_class_code_title', 'product_class_title') + + db.delete_column('indivo_immunization', 'product_class_2_title') + db.rename_column('indivo_immunization', 'product_class_2_code_sys', 'product_class_2_system') + db.rename_column('indivo_immunization', 'product_class_2_code_id', 'product_class_2_identifier') + db.rename_column('indivo_immunization', 'product_class_2_code_title', 'product_class_2_title') + + db.delete_column('indivo_immunization', 'product_name_title') + db.rename_column('indivo_immunization', 'product_name_code_id', 'product_name_identifier') + db.rename_column('indivo_immunization', 'product_name_code_sys', 'product_name_system') + db.rename_column('indivo_immunization', 'product_name_code_title', 'product_name_title') + + db.delete_column('indivo_immunization', 'refusal_reason_title') + db.rename_column('indivo_immunization', 'refusal_reason_code_sys', 'refusal_reason_system') + db.rename_column('indivo_immunization', 'refusal_reason_code_id', 'refusal_reason_identifier') + db.rename_column('indivo_immunization', 'refusal_reason_code_title', 'refusal_reason_title') + + + db.delete_column('indivo_immunization', 'product_class_prov_sc') + db.delete_column('indivo_immunization', 'product_class_prov_tf_id') + db.delete_column('indivo_immunization', 'product_class_prov_tf_sys') + db.delete_column('indivo_immunization', 'product_class_prov_tf_title') + db.delete_column('indivo_immunization', 'product_class_prov_title') + db.delete_column('indivo_immunization', 'product_class_2_prov_sc') + db.delete_column('indivo_immunization', 'product_class_2_prov_tf_id') + db.delete_column('indivo_immunization', 'product_class_2_prov_tf_sys') + db.delete_column('indivo_immunization', 'product_class_2_prov_tf_title') + db.delete_column('indivo_immunization', 'product_class_2_prov_title') + db.delete_column('indivo_immunization', 'refusal_reason_prov_sc') + db.delete_column('indivo_immunization', 'refusal_reason_prov_tf_id') + db.delete_column('indivo_immunization', 'refusal_reason_prov_tf_sys') + db.delete_column('indivo_immunization', 'refusal_reason_prov_tf_title') + db.delete_column('indivo_immunization', 'refusal_reason_prov_title') + db.delete_column('indivo_immunization', 'administration_status_prov_sc') + db.delete_column('indivo_immunization', 'administration_status_prov_tf_id') + db.delete_column('indivo_immunization', 'administration_status_prov_tf_sys') + db.delete_column('indivo_immunization', 'administration_status_prov_tf_title') + db.delete_column('indivo_immunization', 'administration_status_prov_title') + db.delete_column('indivo_immunization', 'product_name_prov_sc') + db.delete_column('indivo_immunization', 'product_name_prov_tf_id') + db.delete_column('indivo_immunization', 'product_name_prov_tf_sys') + db.delete_column('indivo_immunization', 'product_name_prov_tf_title') + db.delete_column('indivo_immunization', 'product_name_prov_title') + + db.delete_column('indivo_problem', 'name_title') + db.rename_column('indivo_problem', 'name_code_id', 'name_identifier') + db.rename_column('indivo_problem', 'name_code_sys', 'name_system') + db.rename_column('indivo_problem', 'name_code_title', 'name_title') + + db.delete_column('indivo_problem', 'name_prov_sc') + db.delete_column('indivo_problem', 'name_prov_tf_id') + db.delete_column('indivo_problem', 'name_prov_tf_sys') + db.delete_column('indivo_problem', 'name_prov_tf_title') + db.delete_column('indivo_problem', 'name_prov_title') + + db.delete_column('indivo_vitalsigns', 'heart_rate_name_title') + db.rename_column('indivo_vitalsigns', 'heart_rate_name_code_id', 'heart_rate_name_identifier') + db.rename_column('indivo_vitalsigns', 'heart_rate_name_code_sys', 'heart_rate_name_system') + db.rename_column('indivo_vitalsigns', 'heart_rate_name_code_title', 'heart_rate_name_title') + + db.delete_column('indivo_vitalsigns', 'oxygen_saturation_name_title') + db.rename_column('indivo_vitalsigns', 'oxygen_saturation_name_code_id', 'oxygen_saturation_name_identifier') + db.rename_column('indivo_vitalsigns', 'oxygen_saturation_name_code_sys', 'oxygen_saturation_name_system') + db.rename_column('indivo_vitalsigns', 'oxygen_saturation_name_code_title', 'oxygen_saturation_name_title') + + db.delete_column('indivo_vitalsigns', 'temperature_name_title') + db.rename_column('indivo_vitalsigns', 'temperature_name_code_id', 'temperature_name_identifier') + db.rename_column('indivo_vitalsigns', 'temperature_name_code_sys', 'temperature_name_system') + db.rename_column('indivo_vitalsigns', 'temperature_name_code_title', 'temperature_name_title') + + db.delete_column('indivo_vitalsigns', 'bp_systolic_name_title') + db.rename_column('indivo_vitalsigns', 'bp_systolic_name_code_id', 'bp_systolic_name_identifier') + db.rename_column('indivo_vitalsigns', 'bp_systolic_name_code_sys', 'bp_systolic_name_system') + db.rename_column('indivo_vitalsigns', 'bp_systolic_name_code_title', 'bp_systolic_name_title') + + db.delete_column('indivo_vitalsigns', 'bp_diastolic_name_title') + db.rename_column('indivo_vitalsigns', 'bp_diastolic_name_code_id', 'bp_diastolic_name_identifier') + db.rename_column('indivo_vitalsigns', 'bp_diastolic_name_code_sys', 'bp_diastolic_name_system') + db.rename_column('indivo_vitalsigns', 'bp_diastolic_name_code_title', 'bp_diastolic_name_title') + + db.delete_column('indivo_vitalsigns', 'height_name_title') + db.rename_column('indivo_vitalsigns', 'height_name_code_id', 'height_name_identifier') + db.rename_column('indivo_vitalsigns', 'height_name_code_sys', 'height_name_system') + db.rename_column('indivo_vitalsigns', 'height_name_code_title', 'height_name_title') + + db.delete_column('indivo_vitalsigns', 'bmi_name_title') + db.rename_column('indivo_vitalsigns', 'bmi_name_code_id', 'bmi_name_identifier') + db.rename_column('indivo_vitalsigns', 'bmi_name_code_sys', 'bmi_name_system') + db.rename_column('indivo_vitalsigns', 'bmi_name_code_title', 'bmi_name_title') + + db.delete_column('indivo_vitalsigns', 'respiratory_rate_name_title') + db.rename_column('indivo_vitalsigns', 'respiratory_rate_name_code_id', 'respiratory_rate_name_identifier') + db.rename_column('indivo_vitalsigns', 'respiratory_rate_name_code_sys', 'respiratory_rate_name_system') + db.rename_column('indivo_vitalsigns', 'respiratory_rate_name_code_title', 'respiratory_rate_name_title') + + db.delete_column('indivo_vitalsigns', 'bp_position_title') + db.rename_column('indivo_vitalsigns', 'bp_position_code_id', 'bp_position_identifier') + db.rename_column('indivo_vitalsigns', 'bp_position_code_sys', 'bp_position_system') + db.rename_column('indivo_vitalsigns', 'bp_position_code_title', 'bp_position_title') + + db.delete_column('indivo_vitalsigns', 'bp_method_title') + db.rename_column('indivo_vitalsigns', 'bp_method_code_id', 'bp_method_identifier') + db.rename_column('indivo_vitalsigns', 'bp_method_code_sys', 'bp_method_system') + db.rename_column('indivo_vitalsigns', 'bp_method_code_title', 'bp_method_title') + + db.delete_column('indivo_vitalsigns', 'bp_site_title') + db.rename_column('indivo_vitalsigns', 'bp_site_code_id', 'bp_site_identifier') + db.rename_column('indivo_vitalsigns', 'bp_site_code_sys', 'bp_site_system') + db.rename_column('indivo_vitalsigns', 'bp_site_code_title', 'bp_site_title') + + db.delete_column('indivo_vitalsigns', 'weight_name_title') + db.rename_column('indivo_vitalsigns', 'weight_name_code_id', 'weight_name_identifier') + db.rename_column('indivo_vitalsigns', 'weight_name_code_sys', 'weight_name_system') + db.rename_column('indivo_vitalsigns', 'weight_name_code_title', 'weight_name_title') + + db.delete_column('indivo_vitalsigns', 'temperature_name_prov_sc') + db.delete_column('indivo_vitalsigns', 'temperature_name_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'temperature_name_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'temperature_name_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'temperature_name_prov_title') + db.delete_column('indivo_vitalsigns', 'weight_name_prov_sc') + db.delete_column('indivo_vitalsigns', 'weight_name_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'weight_name_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'weight_name_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'weight_name_prov_title') + db.delete_column('indivo_vitalsigns', 'oxygen_saturation_name_prov_sc') + db.delete_column('indivo_vitalsigns', 'oxygen_saturation_name_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'oxygen_saturation_name_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'oxygen_saturation_name_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'oxygen_saturation_name_prov_title') + db.delete_column('indivo_vitalsigns', 'bmi_name_prov_sc') + db.delete_column('indivo_vitalsigns', 'bmi_name_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'bmi_name_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'bmi_name_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'bmi_name_prov_title') + db.delete_column('indivo_vitalsigns', 'respiratory_rate_name_prov_sc') + db.delete_column('indivo_vitalsigns', 'respiratory_rate_name_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'respiratory_rate_name_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'respiratory_rate_name_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'respiratory_rate_name_prov_title') + db.delete_column('indivo_vitalsigns', 'height_name_prov_sc') + db.delete_column('indivo_vitalsigns', 'height_name_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'height_name_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'height_name_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'height_name_prov_title') + db.delete_column('indivo_vitalsigns', 'heart_rate_name_prov_sc') + db.delete_column('indivo_vitalsigns', 'heart_rate_name_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'heart_rate_name_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'heart_rate_name_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'heart_rate_name_prov_title') + db.delete_column('indivo_vitalsigns', 'bp_position_prov_sc') + db.delete_column('indivo_vitalsigns', 'bp_position_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'bp_position_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'bp_position_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'bp_position_prov_title') + db.delete_column('indivo_vitalsigns', 'bp_diastolic_name_prov_sc') + db.delete_column('indivo_vitalsigns', 'bp_diastolic_name_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'bp_diastolic_name_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'bp_diastolic_name_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'bp_diastolic_name_prov_title') + db.delete_column('indivo_vitalsigns', 'bp_systolic_name_prov_sc') + db.delete_column('indivo_vitalsigns', 'bp_systolic_name_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'bp_systolic_name_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'bp_systolic_name_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'bp_systolic_name_prov_title') + db.delete_column('indivo_vitalsigns', 'bp_site_prov_sc') + db.delete_column('indivo_vitalsigns', 'bp_site_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'bp_site_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'bp_site_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'bp_site_prov_title') + db.delete_column('indivo_vitalsigns', 'bp_method_prov_sc') + db.delete_column('indivo_vitalsigns', 'bp_method_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'bp_method_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'bp_method_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'bp_method_prov_title') + db.delete_column('indivo_vitalsigns', 'head_circ_value') + db.delete_column('indivo_vitalsigns', 'head_circ_unit') + db.delete_column('indivo_vitalsigns', 'head_circ_name_prov_sc') + db.delete_column('indivo_vitalsigns', 'head_circ_name_prov_tf_id') + db.delete_column('indivo_vitalsigns', 'head_circ_name_prov_tf_sys') + db.delete_column('indivo_vitalsigns', 'head_circ_name_prov_tf_title') + db.delete_column('indivo_vitalsigns', 'head_circ_name_prov_title') + db.delete_column('indivo_vitalsigns', 'head_circ_name_code_id') + db.delete_column('indivo_vitalsigns', 'head_circ_name_code_sys') + db.delete_column('indivo_vitalsigns', 'head_circ_name_code_title') + db.delete_column('indivo_vitalsigns', 'head_circ_name_title') + + + db.delete_column('indivo_allergy', 'drug_class_allergen_title') + db.rename_column('indivo_allergy', 'drug_class_allergen_code_id', 'drug_class_allergen_identifier') + db.rename_column('indivo_allergy', 'drug_class_allergen_code_sys', 'drug_class_allergen_system') + db.rename_column('indivo_allergy', 'drug_class_allergen_code_title', 'drug_class_allergen_title') + + db.delete_column('indivo_allergy', 'category_title') + db.rename_column('indivo_allergy', 'category_code_id', 'category_identifier') + db.rename_column('indivo_allergy', 'category_code_sys', 'category_system') + db.rename_column('indivo_allergy', 'category_code_title', 'category_title') + + db.delete_column('indivo_allergy', 'severity_title') + db.rename_column('indivo_allergy', 'severity_code_id', 'severity_identifier') + db.rename_column('indivo_allergy', 'severity_code_sys', 'severity_system') + db.rename_column('indivo_allergy', 'severity_code_title', 'severity_title') + + db.delete_column('indivo_allergy', 'allergic_reaction_title') + db.rename_column('indivo_allergy', 'allergic_reaction_code_id', 'allergic_reaction_identifier') + db.rename_column('indivo_allergy', 'allergic_reaction_code_sys', 'allergic_reaction_system') + db.rename_column('indivo_allergy', 'allergic_reaction_code_title', 'allergic_reaction_title') + + db.delete_column('indivo_allergy', 'drug_allergen_title') + db.rename_column('indivo_allergy', 'drug_allergen_code_id', 'drug_allergen_identifier') + db.rename_column('indivo_allergy', 'drug_allergen_code_sys', 'drug_allergen_system') + db.rename_column('indivo_allergy', 'drug_allergen_code_title', 'drug_allergen_title') + + db.delete_column('indivo_allergy', 'other_allergen_title') + db.rename_column('indivo_allergy', 'other_allergen_code_id', 'food_allergen_identifier') + db.rename_column('indivo_allergy', 'other_allergen_code_sys', 'food_allergen_system') + db.rename_column('indivo_allergy', 'other_allergen_code_title', 'food_allergen_title') + + db.delete_column('indivo_allergy', 'category_prov_sc') + db.delete_column('indivo_allergy', 'category_prov_tf_id') + db.delete_column('indivo_allergy', 'category_prov_tf_sys') + db.delete_column('indivo_allergy', 'category_prov_tf_title') + db.delete_column('indivo_allergy', 'category_prov_title') + db.delete_column('indivo_allergy', 'severity_prov_sc') + db.delete_column('indivo_allergy', 'severity_prov_tf_id') + db.delete_column('indivo_allergy', 'severity_prov_tf_sys') + db.delete_column('indivo_allergy', 'severity_prov_tf_title') + db.delete_column('indivo_allergy', 'severity_prov_title') + db.delete_column('indivo_allergy', 'drug_allergen_prov_sc') + db.delete_column('indivo_allergy', 'drug_allergen_prov_tf_id') + db.delete_column('indivo_allergy', 'drug_allergen_prov_tf_sys') + db.delete_column('indivo_allergy', 'drug_allergen_prov_tf_title') + db.delete_column('indivo_allergy', 'drug_allergen_prov_title') + db.delete_column('indivo_allergy', 'drug_class_allergen_prov_sc') + db.delete_column('indivo_allergy', 'drug_class_allergen_prov_tf_id') + db.delete_column('indivo_allergy', 'drug_class_allergen_prov_tf_sys') + db.delete_column('indivo_allergy', 'drug_class_allergen_prov_tf_title') + db.delete_column('indivo_allergy', 'drug_class_allergen_prov_title') + db.delete_column('indivo_allergy', 'other_allergen_prov_sc') + db.delete_column('indivo_allergy', 'other_allergen_prov_tf_id') + db.delete_column('indivo_allergy', 'other_allergen_prov_tf_sys') + db.delete_column('indivo_allergy', 'other_allergen_prov_tf_title') + db.delete_column('indivo_allergy', 'other_allergen_prov_title') + db.delete_column('indivo_allergy', 'allergic_reaction_prov_sc') + db.delete_column('indivo_allergy', 'allergic_reaction_prov_tf_id') + db.delete_column('indivo_allergy', 'allergic_reaction_prov_tf_sys') + db.delete_column('indivo_allergy', 'allergic_reaction_prov_tf_title') + db.delete_column('indivo_allergy', 'allergic_reaction_prov_title') + + + db.add_column('indivo_procedure', 'date_performed', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), keep_default=False) + db.add_column('indivo_procedure', 'name_value', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True), keep_default=False) + db.add_column('indivo_procedure', 'name_abbrev', self.gf('django.db.models.fields.CharField')(max_length=20, null=True, blank=True), keep_default=False) + db.add_column('indivo_procedure', 'name', self.gf('django.db.models.fields.CharField')(default='', max_length=100, blank=True), keep_default=False) + db.add_column('indivo_procedure', 'comments', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) + db.add_column('indivo_procedure', 'provider_institution', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True), keep_default=False) + db.add_column('indivo_procedure', 'location', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True), keep_default=False) + db.add_column('indivo_procedure', 'provider_name', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True), keep_default=False) + db.add_column('indivo_procedure', 'name_type', self.gf('django.db.models.fields.CharField')(max_length=80, null=True, blank=True), keep_default=False) + + db.delete_column('indivo_procedure', 'date') + db.delete_column('indivo_procedure', 'notes') + db.delete_column('indivo_procedure', 'status_prov_sc') + db.delete_column('indivo_procedure', 'status_prov_tf_id') + db.delete_column('indivo_procedure', 'status_prov_tf_sys') + db.delete_column('indivo_procedure', 'status_prov_tf_title') + db.delete_column('indivo_procedure', 'status_prov_title') + db.delete_column('indivo_procedure', 'status_code_id') + db.delete_column('indivo_procedure', 'status_code_sys') + db.delete_column('indivo_procedure', 'status_code_title') + db.delete_column('indivo_procedure', 'status_title') + db.delete_column('indivo_procedure', 'name_prov_sc') + db.delete_column('indivo_procedure', 'name_prov_tf_id') + db.delete_column('indivo_procedure', 'name_prov_tf_sys') + db.delete_column('indivo_procedure', 'name_prov_tf_title') + db.delete_column('indivo_procedure', 'name_prov_title') + db.delete_column('indivo_procedure', 'name_code_id') + db.delete_column('indivo_procedure', 'name_code_sys') + db.delete_column('indivo_procedure', 'name_code_title') + db.delete_column('indivo_procedure', 'name_title') + db.delete_column('indivo_procedure', 'provider_bday') + db.delete_column('indivo_procedure', 'provider_dea_number') + db.delete_column('indivo_procedure', 'provider_ethnicity') + db.delete_column('indivo_procedure', 'provider_npi_number') + db.delete_column('indivo_procedure', 'provider_adr_postalcode') + db.delete_column('indivo_procedure', 'provider_adr_country') + db.delete_column('indivo_procedure', 'provider_adr_region') + db.delete_column('indivo_procedure', 'provider_adr_street') + db.delete_column('indivo_procedure', 'provider_adr_city') + db.delete_column('indivo_procedure', 'provider_name_middle') + db.delete_column('indivo_procedure', 'provider_name_given') + db.delete_column('indivo_procedure', 'provider_name_prefix') + db.delete_column('indivo_procedure', 'provider_name_family') + db.delete_column('indivo_procedure', 'provider_name_suffix') + db.delete_column('indivo_procedure', 'provider_preferred_language') + db.delete_column('indivo_procedure', 'provider_tel_2_type') + db.delete_column('indivo_procedure', 'provider_tel_2_number') + db.delete_column('indivo_procedure', 'provider_tel_2_preferred_p') + db.delete_column('indivo_procedure', 'provider_tel_1_type') + db.delete_column('indivo_procedure', 'provider_tel_1_number') + db.delete_column('indivo_procedure', 'provider_tel_1_preferred_p') + db.delete_column('indivo_procedure', 'provider_race') + db.delete_column('indivo_procedure', 'provider_gender') + db.delete_column('indivo_procedure', 'provider_email') + + db.delete_column('indivo_allergyexclusion', 'name_title') + db.rename_column('indivo_allergyexclusion', 'name_code_id', 'name_identifier') + db.rename_column('indivo_allergyexclusion', 'name_code_sys', 'name_system') + db.rename_column('indivo_allergyexclusion', 'name_code_title', 'name_title') + + db.delete_column('indivo_allergyexclusion', 'name_prov_sc') + db.delete_column('indivo_allergyexclusion', 'name_prov_tf_id') + db.delete_column('indivo_allergyexclusion', 'name_prov_tf_sys') + db.delete_column('indivo_allergyexclusion', 'name_prov_tf_title') + db.delete_column('indivo_allergyexclusion', 'name_prov_title') + + db.delete_column('indivo_medication', 'name_title') + db.rename_column('indivo_medication', 'name_code_id', 'drugName_identifier') + db.rename_column('indivo_medication', 'name_code_sys', 'drugName_system') + db.rename_column('indivo_medication', 'name_code_title', 'drugName_title') + + db.delete_column('indivo_medication', 'provenance_title') + db.rename_column('indivo_medication', 'provenance_code_id', 'provenance_identifier') + db.rename_column('indivo_medication', 'provenance_code_sys', 'provenance_system') + db.rename_column('indivo_medication', 'provenance_code_title', 'provenance_title') + + db.delete_column('indivo_medication', 'name_prov_sc') + db.delete_column('indivo_medication', 'name_prov_tf_id') + db.delete_column('indivo_medication', 'name_prov_tf_sys') + db.delete_column('indivo_medication', 'name_prov_tf_title') + db.delete_column('indivo_medication', 'name_prov_title') + db.delete_column('indivo_medication', 'provenance_prov_sc') + db.delete_column('indivo_medication', 'provenance_prov_tf_id') + db.delete_column('indivo_medication', 'provenance_prov_tf_sys') + db.delete_column('indivo_medication', 'provenance_prov_tf_title') + db.delete_column('indivo_medication', 'provenance_prov_title') + + + db.add_column('indivo_labresult', 'collected_by_org_adr_country', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_name_suffix', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_org_adr_city', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_name_given', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_role', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_org_adr_region', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_org_name', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_org_adr_postalcode', self.gf('django.db.models.fields.CharField')(max_length=12, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_name_prefix', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_org_adr_street', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_name_family', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + db.add_column('indivo_labresult', 'collected_by_name_middle', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), keep_default=False) + + db.delete_column('indivo_labresult', 'name_title') + db.rename_column('indivo_labresult', 'name_code_id', 'test_name_identifier') + db.rename_column('indivo_labresult', 'name_code_sys', 'test_name_system') + db.rename_column('indivo_labresult', 'name_code_title', 'test_name_title') + + db.delete_column('indivo_labresult', 'abnormal_interpretation_title') + db.rename_column('indivo_labresult', 'abnormal_interpretation_code_id', 'abnormal_interpretation_identifier') + db.rename_column('indivo_labresult', 'abnormal_interpretation_code_sys', 'abnormal_interpretation_system') + db.rename_column('indivo_labresult', 'abnormal_interpretation_code_title', 'abnormal_interpretation_title') + + db.delete_column('indivo_labresult', 'status_title') + db.rename_column('indivo_labresult', 'status_code_id', 'status_identifier') + db.rename_column('indivo_labresult', 'status_code_sys', 'status_system') + db.rename_column('indivo_labresult', 'status_code_title', 'status_title') + + db.rename_column('indivo_labresult', 'date', 'collected_at') + db.delete_column('indivo_labresult', 'status_prov_sc') + db.delete_column('indivo_labresult', 'status_prov_tf_id') + db.delete_column('indivo_labresult', 'status_prov_tf_sys') + db.delete_column('indivo_labresult', 'status_prov_tf_title') + db.delete_column('indivo_labresult', 'status_prov_title') + db.delete_column('indivo_labresult', 'name_prov_sc') + db.delete_column('indivo_labresult', 'name_prov_tf_id') + db.delete_column('indivo_labresult', 'name_prov_tf_sys') + db.delete_column('indivo_labresult', 'name_prov_tf_title') + db.delete_column('indivo_labresult', 'name_prov_title') + db.delete_column('indivo_labresult', 'abnormal_interpretation_prov_sc') + db.delete_column('indivo_labresult', 'abnormal_interpretation_prov_tf_id') + db.delete_column('indivo_labresult', 'abnormal_interpretation_prov_tf_sys') + db.delete_column('indivo_labresult', 'abnormal_interpretation_prov_tf_title') + db.delete_column('indivo_labresult', 'abnormal_interpretation_prov_title') + + + + + models = { + 'indivo.accesstoken': { + 'Meta': {'object_name': 'AccessToken', '_ormbases': ['indivo.Principal']}, + 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Account']", 'null': 'True'}), + 'carenet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Carenet']", 'null': 'True'}), + 'connect_auth_p': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'expires_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'principal_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Principal']", 'unique': 'True', 'primary_key': 'True'}), + 'share': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.PHAShare']"}), + 'token': ('django.db.models.fields.CharField', [], {'max_length': '40'}), + 'token_secret': ('django.db.models.fields.CharField', [], {'max_length': '60'}) + }, + 'indivo.account': { + 'Meta': {'object_name': 'Account', '_ormbases': ['indivo.Principal']}, + 'account': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Principal']", 'unique': 'True', 'primary_key': 'True'}), + 'contact_email': ('django.db.models.fields.CharField', [], {'max_length': '300'}), + 'failed_login_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'full_name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'last_failed_login_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'last_login_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'last_state_change': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'primary_secret': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True'}), + 'secondary_secret': ('django.db.models.fields.CharField', [], {'max_length': '8', 'null': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'uninitialized'", 'max_length': '50'}), + 'total_login_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}) + }, + 'indivo.accountauthsystem': { + 'Meta': {'unique_together': "(('auth_system', 'account'), ('auth_system', 'username'))", 'object_name': 'AccountAuthSystem'}, + 'account': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'auth_systems'", 'to': "orm['indivo.Account']"}), + 'auth_parameters': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True'}), + 'auth_system': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.AuthSystem']"}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'accountauthsystem_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'user_attributes': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'max_length': '250'}) + }, + 'indivo.accountfullshare': { + 'Meta': {'unique_together': "(('record', 'with_account'),)", 'object_name': 'AccountFullShare'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'accountfullshare_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fullshares'", 'to': "orm['indivo.Record']"}), + 'role_label': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}), + 'with_account': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fullshares_to'", 'to': "orm['indivo.Account']"}) + }, + 'indivo.allergy': { + 'Meta': {'object_name': 'Allergy', '_ormbases': ['indivo.Fact']}, + 'allergic_reaction_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'allergic_reaction_code_id'"}), + 'allergic_reaction_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'allergic_reaction_code_sys'", 'blank': 'True'}), + 'allergic_reaction_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'allergic_reaction_code_title'"}), + 'allergic_reaction_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'allergic_reaction_prov_sc'", 'blank': 'True'}), + 'allergic_reaction_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'allergic_reaction_prov_title'", 'blank': 'True'}), + 'allergic_reaction_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'allergic_reaction_prov_tf_id'", 'blank': 'True'}), + 'allergic_reaction_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'allergic_reaction_prov_tf_sys'", 'blank': 'True'}), + 'allergic_reaction_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'allergic_reaction_prov_tf_title'", 'blank': 'True'}), + 'allergic_reaction_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'allergic_reaction_title'", 'blank': 'True'}), + 'category_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'category_code_id'", 'blank': 'True'}), + 'category_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'category_code_sys'", 'blank': 'True'}), + 'category_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'category_code_title'"}), + 'category_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'category_prov_sc'", 'blank': 'True'}), + 'category_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'category_prov_title'", 'blank': 'True'}), + 'category_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'category_prov_tf_id'", 'blank': 'True'}), + 'category_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'category_prov_tf_sys'", 'blank': 'True'}), + 'category_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'category_prov_tf_title'", 'blank': 'True'}), + 'category_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'category_title'", 'blank': 'True'}), + 'drug_allergen_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_allergen_code_id'", 'blank': 'True'}), + 'drug_allergen_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_allergen_code_sys'", 'blank': 'True'}), + 'drug_allergen_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_allergen_code_title'", 'blank': 'True'}), + 'drug_allergen_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_allergen_prov_sc'", 'blank': 'True'}), + 'drug_allergen_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_allergen_prov_title'", 'blank': 'True'}), + 'drug_allergen_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_allergen_prov_tf_id'", 'blank': 'True'}), + 'drug_allergen_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_allergen_prov_tf_sys'", 'blank': 'True'}), + 'drug_allergen_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_allergen_prov_tf_title'", 'blank': 'True'}), + 'drug_allergen_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_allergen_title'", 'blank': 'True'}), + 'drug_class_allergen_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_class_allergen_code_id'", 'blank': 'True'}), + 'drug_class_allergen_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_class_allergen_code_sys'", 'blank': 'True'}), + 'drug_class_allergen_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_class_allergen_code_title'", 'blank': 'True'}), + 'drug_class_allergen_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_class_allergen_prov_sc'", 'blank': 'True'}), + 'drug_class_allergen_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_class_allergen_prov_title'", 'blank': 'True'}), + 'drug_class_allergen_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_class_allergen_prov_tf_id'", 'blank': 'True'}), + 'drug_class_allergen_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_class_allergen_prov_tf_sys'", 'blank': 'True'}), + 'drug_class_allergen_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_class_allergen_prov_tf_title'", 'blank': 'True'}), + 'drug_class_allergen_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'drug_class_allergen_title'", 'blank': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'other_allergen_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'other_allergen_code_id'", 'blank': 'True'}), + 'other_allergen_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'other_allergen_code_sys'", 'blank': 'True'}), + 'other_allergen_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'other_allergen_code_title'", 'blank': 'True'}), + 'other_allergen_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'other_allergen_prov_sc'", 'blank': 'True'}), + 'other_allergen_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'other_allergen_prov_title'", 'blank': 'True'}), + 'other_allergen_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'other_allergen_prov_tf_id'", 'blank': 'True'}), + 'other_allergen_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'other_allergen_prov_tf_sys'", 'blank': 'True'}), + 'other_allergen_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'other_allergen_prov_tf_title'", 'blank': 'True'}), + 'other_allergen_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'other_allergen_title'", 'blank': 'True'}), + 'severity_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'severity_code_id'", 'blank': 'True'}), + 'severity_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'severity_code_sys'", 'blank': 'True'}), + 'severity_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'severity_code_title'"}), + 'severity_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'severity_prov_sc'", 'blank': 'True'}), + 'severity_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'severity_prov_title'", 'blank': 'True'}), + 'severity_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'severity_prov_tf_id'", 'blank': 'True'}), + 'severity_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'severity_prov_tf_sys'", 'blank': 'True'}), + 'severity_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'severity_prov_tf_title'", 'blank': 'True'}), + 'severity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'severity_title'", 'blank': 'True'}) + }, + 'indivo.allergyexclusion': { + 'Meta': {'object_name': 'AllergyExclusion', '_ormbases': ['indivo.Fact']}, + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_id'", 'blank': 'True'}), + 'name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_sys'", 'blank': 'True'}), + 'name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_title'"}), + 'name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_sc'", 'blank': 'True'}), + 'name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_title'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_id'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_sys'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_title'", 'blank': 'True'}), + 'name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_title'", 'blank': 'True'}) + }, + 'indivo.audit': { + 'Meta': {'object_name': 'Audit'}, + 'carenet_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'datetime': ('django.db.models.fields.DateTimeField', [], {}), + 'document_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'effective_principal_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'message_id': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True'}), + 'pha_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'proxied_by_email': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), + 'record_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'req_domain': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}), + 'req_headers': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'req_ip_address': ('django.db.models.fields.IPAddressField', [], {'max_length': '15', 'null': 'True'}), + 'req_method': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True'}), + 'req_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}), + 'request_successful': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'resp_code': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), + 'resp_headers': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'view_func': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}) + }, + 'indivo.authsystem': { + 'Meta': {'object_name': 'AuthSystem'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'authsystem_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'internal_p': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'short_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'indivo.carenet': { + 'Meta': {'unique_together': "(('name', 'record'),)", 'object_name': 'Carenet'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'carenet_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}), + 'record': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Record']"}) + }, + 'indivo.carenetaccount': { + 'Meta': {'unique_together': "(('carenet', 'account'),)", 'object_name': 'CarenetAccount'}, + 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Account']"}), + 'can_write': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'carenet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Carenet']"}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'carenetaccount_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}) + }, + 'indivo.carenetautoshare': { + 'Meta': {'unique_together': "(('carenet', 'record', 'type'),)", 'object_name': 'CarenetAutoshare'}, + 'carenet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Carenet']"}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'carenetautoshare_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'record': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Record']"}), + 'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.DocumentSchema']", 'null': 'True'}) + }, + 'indivo.carenetdocument': { + 'Meta': {'unique_together': "(('carenet', 'document'),)", 'object_name': 'CarenetDocument'}, + 'carenet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Carenet']"}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'carenetdocument_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'document': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Document']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'share_p': ('django.db.models.fields.BooleanField', [], {'default': 'True'}) + }, + 'indivo.carenetpha': { + 'Meta': {'unique_together': "(('carenet', 'pha'),)", 'object_name': 'CarenetPHA'}, + 'carenet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Carenet']"}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'carenetpha_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'pha': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.PHA']"}) + }, + 'indivo.demographics': { + 'Meta': {'object_name': 'Demographics'}, + 'adr_city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'adr_city'", 'blank': 'True'}), + 'adr_country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'adr_country'", 'blank': 'True'}), + 'adr_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True', 'db_column': "'adr_postalcode'", 'blank': 'True'}), + 'adr_region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'adr_region'", 'blank': 'True'}), + 'adr_street': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'adr_street'", 'blank': 'True'}), + 'bday': ('django.db.models.fields.DateField', [], {'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'document': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Document']", 'null': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'ethnicity': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'gender': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name_family': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_family'", 'blank': 'True'}), + 'name_given': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_given'", 'blank': 'True'}), + 'name_middle': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_middle'", 'blank': 'True'}), + 'name_prefix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prefix'", 'blank': 'True'}), + 'name_suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_suffix'", 'blank': 'True'}), + 'preferred_language': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'race': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'tel_1_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'db_column': "'tel_1_number'", 'blank': 'True'}), + 'tel_1_preferred_p': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'tel_1_preferred_p'"}), + 'tel_1_type': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'db_column': "'tel_1_type'", 'blank': 'True'}), + 'tel_2_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'db_column': "'tel_2_number'", 'blank': 'True'}), + 'tel_2_preferred_p': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'tel_2_preferred_p'"}), + 'tel_2_type': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'db_column': "'tel_2_type'", 'blank': 'True'}) + }, + 'indivo.document': { + 'Meta': {'unique_together': "(('record', 'external_id'),)", 'object_name': 'Document'}, + 'content': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'content_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'document_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'digest': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True'}), + 'fqn': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}), + 'mime_type': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'nevershare': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'original': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'document_thread'", 'null': 'True', 'to': "orm['indivo.Document']"}), + 'pha': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pha_document'", 'null': 'True', 'to': "orm['indivo.PHA']"}), + 'processed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'documents'", 'null': 'True', 'to': "orm['indivo.Record']"}), + 'replaced_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'document_replaced'", 'null': 'True', 'to': "orm['indivo.Document']"}), + 'replaces': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Document']", 'null': 'True'}), + 'size': ('django.db.models.fields.IntegerField', [], {}), + 'status': ('django.db.models.fields.related.ForeignKey', [], {'default': '1', 'to': "orm['indivo.StatusName']"}), + 'suppressed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'suppressed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Principal']", 'null': 'True'}) + }, + 'indivo.documentrels': { + 'Meta': {'object_name': 'DocumentRels'}, + 'document_0': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'rels_as_doc_0'", 'to': "orm['indivo.Document']"}), + 'document_1': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'rels_as_doc_1'", 'to': "orm['indivo.Document']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'relationship': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.DocumentSchema']"}) + }, + 'indivo.documentschema': { + 'Meta': {'object_name': 'DocumentSchema'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'documentschema_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'internal_p': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'stylesheet': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'stylesheet'", 'null': 'True', 'to': "orm['indivo.Document']"}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '500'}) + }, + 'indivo.documentstatushistory': { + 'Meta': {'object_name': 'DocumentStatusHistory'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'documentstatushistory_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'document': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'effective_principal': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'proxied_by_principal': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}), + 'reason': ('django.db.models.fields.TextField', [], {}), + 'record': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'status': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.StatusName']"}) + }, + 'indivo.encounter': { + 'Meta': {'object_name': 'Encounter', '_ormbases': ['indivo.Fact']}, + 'endDate': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'facility_adr_city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'facility_adr_city'", 'blank': 'True'}), + 'facility_adr_country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'facility_adr_country'", 'blank': 'True'}), + 'facility_adr_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True', 'db_column': "'facility_adr_postalcode'", 'blank': 'True'}), + 'facility_adr_region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'facility_adr_region'", 'blank': 'True'}), + 'facility_adr_street': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'facility_adr_street'", 'blank': 'True'}), + 'facility_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'facility_name'", 'blank': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'provider_adr_city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_city'", 'blank': 'True'}), + 'provider_adr_country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_country'", 'blank': 'True'}), + 'provider_adr_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True', 'db_column': "'provider_adr_postalcode'", 'blank': 'True'}), + 'provider_adr_region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_region'", 'blank': 'True'}), + 'provider_adr_street': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_street'", 'blank': 'True'}), + 'provider_bday': ('django.db.models.fields.DateField', [], {'null': 'True', 'db_column': "'provider_bday'", 'blank': 'True'}), + 'provider_dea_number': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_dea_number'", 'blank': 'True'}), + 'provider_email': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_email'", 'blank': 'True'}), + 'provider_ethnicity': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_ethnicity'", 'blank': 'True'}), + 'provider_gender': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_gender'", 'blank': 'True'}), + 'provider_name_family': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_family'", 'blank': 'True'}), + 'provider_name_given': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_given'", 'blank': 'True'}), + 'provider_name_middle': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_middle'", 'blank': 'True'}), + 'provider_name_prefix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_prefix'", 'blank': 'True'}), + 'provider_name_suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_suffix'", 'blank': 'True'}), + 'provider_npi_number': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_npi_number'", 'blank': 'True'}), + 'provider_preferred_language': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_preferred_language'", 'blank': 'True'}), + 'provider_race': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_race'", 'blank': 'True'}), + 'provider_tel_1_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'db_column': "'provider_tel_1_number'", 'blank': 'True'}), + 'provider_tel_1_preferred_p': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'provider_tel_1_preferred_p'"}), + 'provider_tel_1_type': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'db_column': "'provider_tel_1_type'", 'blank': 'True'}), + 'provider_tel_2_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'db_column': "'provider_tel_2_number'", 'blank': 'True'}), + 'provider_tel_2_preferred_p': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'provider_tel_2_preferred_p'"}), + 'provider_tel_2_type': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'db_column': "'provider_tel_2_type'", 'blank': 'True'}), + 'startDate': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'type_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'type_code_id'", 'blank': 'True'}), + 'type_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'type_code_sys'", 'blank': 'True'}), + 'type_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'type_code_title'"}), + 'type_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'type_prov_sc'", 'blank': 'True'}), + 'type_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'type_prov_title'", 'blank': 'True'}), + 'type_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'type_prov_tf_id'", 'blank': 'True'}), + 'type_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'type_prov_tf_sys'", 'blank': 'True'}), + 'type_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'type_prov_tf_title'", 'blank': 'True'}), + 'type_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'type_title'", 'blank': 'True'}) + }, + 'indivo.equipment': { + 'Meta': {'object_name': 'Equipment', '_ormbases': ['indivo.Fact']}, + 'date_started': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'date_stopped': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}), + 'vendor': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}) + }, + 'indivo.fact': { + 'Meta': {'object_name': 'Fact'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'document': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Document']", 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'record': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Record']", 'null': 'True', 'blank': 'True'}) + }, + 'indivo.fill': { + 'Meta': {'object_name': 'Fill', '_ormbases': ['indivo.Fact']}, + 'date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'dispenseDaysSupply': ('django.db.models.fields.FloatField', [], {'null': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'medication': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'fulfillments'", 'null': 'True', 'to': "orm['indivo.Medication']"}), + 'pbm': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'pharmacy_adr_city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'pharmacy_adr_city'", 'blank': 'True'}), + 'pharmacy_adr_country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'pharmacy_adr_country'", 'blank': 'True'}), + 'pharmacy_adr_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True', 'db_column': "'pharmacy_adr_postalcode'", 'blank': 'True'}), + 'pharmacy_adr_region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'pharmacy_adr_region'", 'blank': 'True'}), + 'pharmacy_adr_street': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'pharmacy_adr_street'", 'blank': 'True'}), + 'pharmacy_ncpdpid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'pharmacy_ncpdpid'", 'blank': 'True'}), + 'pharmacy_org': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'pharmacy_org'", 'blank': 'True'}), + 'provider_adr_city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_city'", 'blank': 'True'}), + 'provider_adr_country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_country'", 'blank': 'True'}), + 'provider_adr_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True', 'db_column': "'provider_adr_postalcode'", 'blank': 'True'}), + 'provider_adr_region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_region'", 'blank': 'True'}), + 'provider_adr_street': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_street'", 'blank': 'True'}), + 'provider_bday': ('django.db.models.fields.DateField', [], {'null': 'True', 'db_column': "'provider_bday'", 'blank': 'True'}), + 'provider_dea_number': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_dea_number'", 'blank': 'True'}), + 'provider_email': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_email'", 'blank': 'True'}), + 'provider_ethnicity': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_ethnicity'", 'blank': 'True'}), + 'provider_gender': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_gender'", 'blank': 'True'}), + 'provider_name_family': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_family'", 'blank': 'True'}), + 'provider_name_given': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_given'", 'blank': 'True'}), + 'provider_name_middle': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_middle'", 'blank': 'True'}), + 'provider_name_prefix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_prefix'", 'blank': 'True'}), + 'provider_name_suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_suffix'", 'blank': 'True'}), + 'provider_npi_number': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_npi_number'", 'blank': 'True'}), + 'provider_preferred_language': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_preferred_language'", 'blank': 'True'}), + 'provider_race': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_race'", 'blank': 'True'}), + 'provider_tel_1_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'db_column': "'provider_tel_1_number'", 'blank': 'True'}), + 'provider_tel_1_preferred_p': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'provider_tel_1_preferred_p'"}), + 'provider_tel_1_type': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'db_column': "'provider_tel_1_type'", 'blank': 'True'}), + 'provider_tel_2_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'db_column': "'provider_tel_2_number'", 'blank': 'True'}), + 'provider_tel_2_preferred_p': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'provider_tel_2_preferred_p'"}), + 'provider_tel_2_type': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'db_column': "'provider_tel_2_type'", 'blank': 'True'}), + 'quantityDispensed_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantityDispensed_unit'", 'blank': 'True'}), + 'quantityDispensed_value': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantityDispensed_value'", 'blank': 'True'}) + }, + 'indivo.immunization': { + 'Meta': {'object_name': 'Immunization', '_ormbases': ['indivo.Fact']}, + 'administration_status_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'administration_status_code_id'", 'blank': 'True'}), + 'administration_status_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'administration_status_code_sys'", 'blank': 'True'}), + 'administration_status_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'administration_status_code_title'"}), + 'administration_status_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'administration_status_prov_sc'", 'blank': 'True'}), + 'administration_status_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'administration_status_prov_title'", 'blank': 'True'}), + 'administration_status_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'administration_status_prov_tf_id'", 'blank': 'True'}), + 'administration_status_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'administration_status_prov_tf_sys'", 'blank': 'True'}), + 'administration_status_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'administration_status_prov_tf_title'", 'blank': 'True'}), + 'administration_status_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'administration_status_title'", 'blank': 'True'}), + 'date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'product_class_2_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_2_code_id'", 'blank': 'True'}), + 'product_class_2_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_2_code_sys'", 'blank': 'True'}), + 'product_class_2_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_2_code_title'", 'blank': 'True'}), + 'product_class_2_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_2_prov_sc'", 'blank': 'True'}), + 'product_class_2_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_2_prov_title'", 'blank': 'True'}), + 'product_class_2_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_2_prov_tf_id'", 'blank': 'True'}), + 'product_class_2_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_2_prov_tf_sys'", 'blank': 'True'}), + 'product_class_2_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_2_prov_tf_title'", 'blank': 'True'}), + 'product_class_2_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_2_title'", 'blank': 'True'}), + 'product_class_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_code_id'", 'blank': 'True'}), + 'product_class_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_code_sys'", 'blank': 'True'}), + 'product_class_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_code_title'", 'blank': 'True'}), + 'product_class_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_prov_sc'", 'blank': 'True'}), + 'product_class_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_prov_title'", 'blank': 'True'}), + 'product_class_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_prov_tf_id'", 'blank': 'True'}), + 'product_class_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_prov_tf_sys'", 'blank': 'True'}), + 'product_class_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_prov_tf_title'", 'blank': 'True'}), + 'product_class_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_class_title'", 'blank': 'True'}), + 'product_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_name_code_id'"}), + 'product_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_name_code_sys'", 'blank': 'True'}), + 'product_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_name_code_title'"}), + 'product_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_name_prov_sc'", 'blank': 'True'}), + 'product_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_name_prov_title'", 'blank': 'True'}), + 'product_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_name_prov_tf_id'", 'blank': 'True'}), + 'product_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_name_prov_tf_sys'", 'blank': 'True'}), + 'product_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_name_prov_tf_title'", 'blank': 'True'}), + 'product_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'product_name_title'", 'blank': 'True'}), + 'refusal_reason_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'refusal_reason_code_id'", 'blank': 'True'}), + 'refusal_reason_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'refusal_reason_code_sys'", 'blank': 'True'}), + 'refusal_reason_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'refusal_reason_code_title'", 'blank': 'True'}), + 'refusal_reason_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'refusal_reason_prov_sc'", 'blank': 'True'}), + 'refusal_reason_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'refusal_reason_prov_title'", 'blank': 'True'}), + 'refusal_reason_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'refusal_reason_prov_tf_id'", 'blank': 'True'}), + 'refusal_reason_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'refusal_reason_prov_tf_sys'", 'blank': 'True'}), + 'refusal_reason_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'refusal_reason_prov_tf_title'", 'blank': 'True'}), + 'refusal_reason_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'refusal_reason_title'", 'blank': 'True'}) + }, + 'indivo.labresult': { + 'Meta': {'object_name': 'LabResult', '_ormbases': ['indivo.Fact']}, + 'abnormal_interpretation_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'abnormal_interpretation_code_id'", 'blank': 'True'}), + 'abnormal_interpretation_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'abnormal_interpretation_code_sys'", 'blank': 'True'}), + 'abnormal_interpretation_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'abnormal_interpretation_code_title'", 'blank': 'True'}), + 'abnormal_interpretation_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'abnormal_interpretation_prov_sc'", 'blank': 'True'}), + 'abnormal_interpretation_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'abnormal_interpretation_prov_title'", 'blank': 'True'}), + 'abnormal_interpretation_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'abnormal_interpretation_prov_tf_id'", 'blank': 'True'}), + 'abnormal_interpretation_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'abnormal_interpretation_prov_tf_sys'", 'blank': 'True'}), + 'abnormal_interpretation_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'abnormal_interpretation_prov_tf_title'", 'blank': 'True'}), + 'abnormal_interpretation_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'abnormal_interpretation_title'", 'blank': 'True'}), + 'accession_number': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_id'"}), + 'name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_sys'", 'blank': 'True'}), + 'name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_title'"}), + 'name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_sc'", 'blank': 'True'}), + 'name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_title'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_id'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_sys'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_title'", 'blank': 'True'}), + 'name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_title'", 'blank': 'True'}), + 'narrative_result': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'notes': ('django.db.models.fields.CharField', [], {'max_length': '600', 'null': 'True', 'blank': 'True'}), + 'quantitative_result_non_critical_range_max_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantitative_result_non_critical_range_max_unit'", 'blank': 'True'}), + 'quantitative_result_non_critical_range_max_value': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantitative_result_non_critical_range_max_value'", 'blank': 'True'}), + 'quantitative_result_non_critical_range_min_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantitative_result_non_critical_range_min_unit'", 'blank': 'True'}), + 'quantitative_result_non_critical_range_min_value': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantitative_result_non_critical_range_min_value'", 'blank': 'True'}), + 'quantitative_result_normal_range_max_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantitative_result_normal_range_max_unit'", 'blank': 'True'}), + 'quantitative_result_normal_range_max_value': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantitative_result_normal_range_max_value'", 'blank': 'True'}), + 'quantitative_result_normal_range_min_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantitative_result_normal_range_min_unit'", 'blank': 'True'}), + 'quantitative_result_normal_range_min_value': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantitative_result_normal_range_min_value'", 'blank': 'True'}), + 'quantitative_result_value_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantitative_result_value_unit'", 'blank': 'True'}), + 'quantitative_result_value_value': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantitative_result_value_value'", 'blank': 'True'}), + 'status_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_code_id'", 'blank': 'True'}), + 'status_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_code_sys'", 'blank': 'True'}), + 'status_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_code_title'", 'blank': 'True'}), + 'status_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_prov_sc'", 'blank': 'True'}), + 'status_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_prov_title'", 'blank': 'True'}), + 'status_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_prov_tf_id'", 'blank': 'True'}), + 'status_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_prov_tf_sys'", 'blank': 'True'}), + 'status_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_prov_tf_title'", 'blank': 'True'}), + 'status_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_title'", 'blank': 'True'}) + }, + 'indivo.machineapp': { + 'Meta': {'object_name': 'MachineApp'}, + 'app_type': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'author': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True'}), + 'consumer_key': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'description': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True'}), + 'indivo_version': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'principal_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Principal']", 'unique': 'True', 'primary_key': 'True'}), + 'secret': ('django.db.models.fields.CharField', [], {'max_length': '60'}), + 'version': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True'}) + }, + 'indivo.measurement': { + 'Meta': {'object_name': 'Measurement', '_ormbases': ['indivo.Fact']}, + 'datetime': ('django.db.models.fields.DateTimeField', [], {'blank': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '24', 'blank': 'True'}), + 'unit': ('django.db.models.fields.CharField', [], {'max_length': '8', 'blank': 'True'}), + 'value': ('django.db.models.fields.FloatField', [], {'blank': 'True'}) + }, + 'indivo.medication': { + 'Meta': {'object_name': 'Medication', '_ormbases': ['indivo.Fact']}, + 'endDate': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'frequency_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'frequency_unit'", 'blank': 'True'}), + 'frequency_value': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'frequency_value'", 'blank': 'True'}), + 'instructions': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_id'"}), + 'name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_sys'", 'blank': 'True'}), + 'name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_title'"}), + 'name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_sc'", 'blank': 'True'}), + 'name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_title'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_id'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_sys'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_title'", 'blank': 'True'}), + 'name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_title'", 'blank': 'True'}), + 'provenance_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provenance_code_id'", 'blank': 'True'}), + 'provenance_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provenance_code_sys'", 'blank': 'True'}), + 'provenance_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provenance_code_title'", 'blank': 'True'}), + 'provenance_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provenance_prov_sc'", 'blank': 'True'}), + 'provenance_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provenance_prov_title'", 'blank': 'True'}), + 'provenance_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provenance_prov_tf_id'", 'blank': 'True'}), + 'provenance_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provenance_prov_tf_sys'", 'blank': 'True'}), + 'provenance_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provenance_prov_tf_title'", 'blank': 'True'}), + 'provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provenance_title'", 'blank': 'True'}), + 'quantity_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantity_unit'", 'blank': 'True'}), + 'quantity_value': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'quantity_value'", 'blank': 'True'}), + 'startDate': ('django.db.models.fields.DateField', [], {'null': 'True'}) + }, + 'indivo.message': { + 'Meta': {'unique_together': "(('account', 'external_identifier', 'sender'),)", 'object_name': 'Message'}, + 'about_record': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Record']", 'null': 'True'}), + 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Account']"}), + 'archived_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'body': ('django.db.models.fields.TextField', [], {}), + 'body_type': ('django.db.models.fields.CharField', [], {'default': "'plaintext'", 'max_length': '100'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'message_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'external_identifier': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True'}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'num_attachments': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'read_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'received_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'recipient': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'message_as_recipient'", 'to': "orm['indivo.Principal']"}), + 'response_to': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'message_responses'", 'null': 'True', 'to': "orm['indivo.Message']"}), + 'sender': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'message_as_sender'", 'to': "orm['indivo.Principal']"}), + 'severity': ('django.db.models.fields.CharField', [], {'default': "'low'", 'max_length': '100'}), + 'subject': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'indivo.messageattachment': { + 'Meta': {'unique_together': "(('message', 'attachment_num'),)", 'object_name': 'MessageAttachment'}, + 'attachment_num': ('django.db.models.fields.IntegerField', [], {}), + 'content': ('django.db.models.fields.TextField', [], {}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'messageattachment_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'message': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Message']"}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'saved_to_document': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Document']", 'null': 'True'}), + 'size': ('django.db.models.fields.IntegerField', [], {}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '250'}) + }, + 'indivo.nonce': { + 'Meta': {'unique_together': "(('nonce', 'oauth_type'),)", 'object_name': 'Nonce'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'nonce': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'oauth_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}) + }, + 'indivo.notification': { + 'Meta': {'object_name': 'Notification'}, + 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Account']"}), + 'app_url': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True'}), + 'content': ('django.db.models.fields.CharField', [], {'max_length': '500'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'notification_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'document': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Document']", 'null': 'True'}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'record': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Record']", 'null': 'True'}), + 'sender': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'notifications_sent_by'", 'to': "orm['indivo.Principal']"}) + }, + 'indivo.nouser': { + 'Meta': {'object_name': 'NoUser', '_ormbases': ['indivo.Principal']}, + 'principal_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Principal']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'indivo.pha': { + 'Meta': {'object_name': 'PHA'}, + 'author': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True'}), + 'autonomous_reason': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'callback_url': ('django.db.models.fields.CharField', [], {'max_length': '500'}), + 'consumer_key': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'description': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True'}), + 'frameable': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'has_ui': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'icon_url': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True'}), + 'indivo_version': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True'}), + 'is_autonomous': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'principal_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Principal']", 'unique': 'True', 'primary_key': 'True'}), + 'requirements': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'secret': ('django.db.models.fields.CharField', [], {'max_length': '60'}), + 'start_url_template': ('django.db.models.fields.CharField', [], {'max_length': '500'}), + 'version': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True'}) + }, + 'indivo.phashare': { + 'Meta': {'unique_together': "(('record', 'with_pha'),)", 'object_name': 'PHAShare'}, + 'authorized_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'authorized_by': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'shares_authorized_by'", 'null': 'True', 'to': "orm['indivo.Account']"}), + 'carenet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Carenet']", 'null': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'phashare_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pha_shares'", 'to': "orm['indivo.Record']"}), + 'with_pha': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pha_shares_to'", 'to': "orm['indivo.PHA']"}) + }, + 'indivo.principal': { + 'Meta': {'object_name': 'Principal'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'principal_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'email': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'indivo.problem': { + 'Meta': {'object_name': 'Problem', '_ormbases': ['indivo.Fact']}, + 'endDate': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_id'"}), + 'name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_sys'", 'blank': 'True'}), + 'name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_title'"}), + 'name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_sc'", 'blank': 'True'}), + 'name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_title'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_id'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_sys'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_title'", 'blank': 'True'}), + 'name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_title'", 'blank': 'True'}), + 'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'startDate': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}) + }, + 'indivo.procedure': { + 'Meta': {'object_name': 'Procedure', '_ormbases': ['indivo.Fact']}, + 'date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_id'", 'blank': 'True'}), + 'name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_sys'", 'blank': 'True'}), + 'name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_code_title'", 'blank': 'True'}), + 'name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_sc'", 'blank': 'True'}), + 'name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_title'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_id'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_sys'", 'blank': 'True'}), + 'name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_prov_tf_title'", 'blank': 'True'}), + 'name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'name_title'", 'blank': 'True'}), + 'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'provider_adr_city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_city'", 'blank': 'True'}), + 'provider_adr_country': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_country'", 'blank': 'True'}), + 'provider_adr_postalcode': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True', 'db_column': "'provider_adr_postalcode'", 'blank': 'True'}), + 'provider_adr_region': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_region'", 'blank': 'True'}), + 'provider_adr_street': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_adr_street'", 'blank': 'True'}), + 'provider_bday': ('django.db.models.fields.DateField', [], {'null': 'True', 'db_column': "'provider_bday'", 'blank': 'True'}), + 'provider_dea_number': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_dea_number'", 'blank': 'True'}), + 'provider_email': ('django.db.models.fields.EmailField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_email'", 'blank': 'True'}), + 'provider_ethnicity': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_ethnicity'", 'blank': 'True'}), + 'provider_gender': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_gender'", 'blank': 'True'}), + 'provider_name_family': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_family'", 'blank': 'True'}), + 'provider_name_given': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_given'", 'blank': 'True'}), + 'provider_name_middle': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_middle'", 'blank': 'True'}), + 'provider_name_prefix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_prefix'", 'blank': 'True'}), + 'provider_name_suffix': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_name_suffix'", 'blank': 'True'}), + 'provider_npi_number': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_npi_number'", 'blank': 'True'}), + 'provider_preferred_language': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_preferred_language'", 'blank': 'True'}), + 'provider_race': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'provider_race'", 'blank': 'True'}), + 'provider_tel_1_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'db_column': "'provider_tel_1_number'", 'blank': 'True'}), + 'provider_tel_1_preferred_p': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'provider_tel_1_preferred_p'"}), + 'provider_tel_1_type': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'db_column': "'provider_tel_1_type'", 'blank': 'True'}), + 'provider_tel_2_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'db_column': "'provider_tel_2_number'", 'blank': 'True'}), + 'provider_tel_2_preferred_p': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_column': "'provider_tel_2_preferred_p'"}), + 'provider_tel_2_type': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'db_column': "'provider_tel_2_type'", 'blank': 'True'}), + 'status_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_code_id'", 'blank': 'True'}), + 'status_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_code_sys'", 'blank': 'True'}), + 'status_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_code_title'", 'blank': 'True'}), + 'status_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_prov_sc'", 'blank': 'True'}), + 'status_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_prov_title'", 'blank': 'True'}), + 'status_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_prov_tf_id'", 'blank': 'True'}), + 'status_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_prov_tf_sys'", 'blank': 'True'}), + 'status_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_prov_tf_title'", 'blank': 'True'}), + 'status_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'status_title'", 'blank': 'True'}) + }, + 'indivo.record': { + 'Meta': {'object_name': 'Record'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'record_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'demographics': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Demographics']", 'unique': 'True', 'null': 'True'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '250', 'unique': 'True', 'null': 'True'}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'records_owned_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}) + }, + 'indivo.recordnotificationroute': { + 'Meta': {'unique_together': "(('account', 'record'),)", 'object_name': 'RecordNotificationRoute'}, + 'account': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Account']"}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'recordnotificationroute_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'notification_routes'", 'to': "orm['indivo.Record']"}) + }, + 'indivo.reqtoken': { + 'Meta': {'object_name': 'ReqToken', '_ormbases': ['indivo.Principal']}, + 'authorized_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'authorized_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Account']", 'null': 'True'}), + 'carenet': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Carenet']", 'null': 'True'}), + 'oauth_callback': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True'}), + 'pha': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.PHA']"}), + 'principal_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Principal']", 'unique': 'True', 'primary_key': 'True'}), + 'record': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Record']", 'null': 'True'}), + 'share': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.PHAShare']", 'null': 'True'}), + 'token': ('django.db.models.fields.CharField', [], {'max_length': '40'}), + 'token_secret': ('django.db.models.fields.CharField', [], {'max_length': '60'}), + 'verifier': ('django.db.models.fields.CharField', [], {'max_length': '60'}) + }, + 'indivo.sessionrequesttoken': { + 'Meta': {'object_name': 'SessionRequestToken'}, + 'approved_p': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sessionrequesttoken_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'secret': ('django.db.models.fields.CharField', [], {'max_length': '60'}), + 'token': ('django.db.models.fields.CharField', [], {'max_length': '40'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Account']", 'null': 'True'}) + }, + 'indivo.sessiontoken': { + 'Meta': {'object_name': 'SessionToken'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sessiontoken_created_by'", 'null': 'True', 'to': "orm['indivo.Principal']"}), + 'expires_at': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('django.db.models.fields.CharField', [], {'max_length': '50', 'primary_key': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'auto_now_add': 'True', 'blank': 'True'}), + 'secret': ('django.db.models.fields.CharField', [], {'max_length': '60'}), + 'token': ('django.db.models.fields.CharField', [], {'max_length': '40'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Account']", 'null': 'True'}) + }, + 'indivo.simpleclinicalnote': { + 'Meta': {'object_name': 'SimpleClinicalNote', '_ormbases': ['indivo.Fact']}, + 'chief_complaint': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'content': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'date_of_visit': ('django.db.models.fields.DateTimeField', [], {'blank': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'finalized_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'provider_institution': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'provider_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'signed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'specialty': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'specialty_abbrev': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), + 'specialty_type': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True', 'blank': 'True'}), + 'specialty_value': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), + 'visit_location': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'visit_type': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'visit_type_abbrev': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), + 'visit_type_type': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True', 'blank': 'True'}), + 'visit_type_value': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}) + }, + 'indivo.statusname': { + 'Meta': {'object_name': 'StatusName'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '24'}) + }, + 'indivo.vitalsigns': { + 'Meta': {'object_name': 'VitalSigns', '_ormbases': ['indivo.Fact']}, + 'bmi_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bmi_name_code_id'", 'blank': 'True'}), + 'bmi_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bmi_name_code_sys'", 'blank': 'True'}), + 'bmi_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bmi_name_code_title'", 'blank': 'True'}), + 'bmi_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bmi_name_prov_sc'", 'blank': 'True'}), + 'bmi_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bmi_name_prov_title'", 'blank': 'True'}), + 'bmi_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bmi_name_prov_tf_id'", 'blank': 'True'}), + 'bmi_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bmi_name_prov_tf_sys'", 'blank': 'True'}), + 'bmi_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bmi_name_prov_tf_title'", 'blank': 'True'}), + 'bmi_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bmi_name_title'", 'blank': 'True'}), + 'bmi_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bmi_unit'", 'blank': 'True'}), + 'bmi_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'db_column': "'bmi_value'", 'blank': 'True'}), + 'bp_diastolic_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_diastolic_name_code_id'", 'blank': 'True'}), + 'bp_diastolic_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_diastolic_name_code_sys'", 'blank': 'True'}), + 'bp_diastolic_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_diastolic_name_code_title'", 'blank': 'True'}), + 'bp_diastolic_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_diastolic_name_prov_sc'", 'blank': 'True'}), + 'bp_diastolic_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_diastolic_name_prov_title'", 'blank': 'True'}), + 'bp_diastolic_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_diastolic_name_prov_tf_id'", 'blank': 'True'}), + 'bp_diastolic_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_diastolic_name_prov_tf_sys'", 'blank': 'True'}), + 'bp_diastolic_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_diastolic_name_prov_tf_title'", 'blank': 'True'}), + 'bp_diastolic_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_diastolic_name_title'", 'blank': 'True'}), + 'bp_diastolic_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_diastolic_unit'", 'blank': 'True'}), + 'bp_diastolic_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'db_column': "'bp_diastolic_value'", 'blank': 'True'}), + 'bp_method_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_method_code_id'", 'blank': 'True'}), + 'bp_method_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_method_code_sys'", 'blank': 'True'}), + 'bp_method_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_method_code_title'", 'blank': 'True'}), + 'bp_method_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_method_prov_sc'", 'blank': 'True'}), + 'bp_method_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_method_prov_title'", 'blank': 'True'}), + 'bp_method_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_method_prov_tf_id'", 'blank': 'True'}), + 'bp_method_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_method_prov_tf_sys'", 'blank': 'True'}), + 'bp_method_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_method_prov_tf_title'", 'blank': 'True'}), + 'bp_method_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_method_title'", 'blank': 'True'}), + 'bp_position_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_position_code_id'", 'blank': 'True'}), + 'bp_position_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_position_code_sys'", 'blank': 'True'}), + 'bp_position_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_position_code_title'", 'blank': 'True'}), + 'bp_position_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_position_prov_sc'", 'blank': 'True'}), + 'bp_position_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_position_prov_title'", 'blank': 'True'}), + 'bp_position_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_position_prov_tf_id'", 'blank': 'True'}), + 'bp_position_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_position_prov_tf_sys'", 'blank': 'True'}), + 'bp_position_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_position_prov_tf_title'", 'blank': 'True'}), + 'bp_position_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_position_title'", 'blank': 'True'}), + 'bp_site_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_site_code_id'", 'blank': 'True'}), + 'bp_site_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_site_code_sys'", 'blank': 'True'}), + 'bp_site_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_site_code_title'", 'blank': 'True'}), + 'bp_site_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_site_prov_sc'", 'blank': 'True'}), + 'bp_site_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_site_prov_title'", 'blank': 'True'}), + 'bp_site_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_site_prov_tf_id'", 'blank': 'True'}), + 'bp_site_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_site_prov_tf_sys'", 'blank': 'True'}), + 'bp_site_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_site_prov_tf_title'", 'blank': 'True'}), + 'bp_site_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_site_title'", 'blank': 'True'}), + 'bp_systolic_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_systolic_name_code_id'", 'blank': 'True'}), + 'bp_systolic_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_systolic_name_code_sys'", 'blank': 'True'}), + 'bp_systolic_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_systolic_name_code_title'", 'blank': 'True'}), + 'bp_systolic_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_systolic_name_prov_sc'", 'blank': 'True'}), + 'bp_systolic_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_systolic_name_prov_title'", 'blank': 'True'}), + 'bp_systolic_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_systolic_name_prov_tf_id'", 'blank': 'True'}), + 'bp_systolic_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_systolic_name_prov_tf_sys'", 'blank': 'True'}), + 'bp_systolic_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_systolic_name_prov_tf_title'", 'blank': 'True'}), + 'bp_systolic_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_systolic_name_title'", 'blank': 'True'}), + 'bp_systolic_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'bp_systolic_unit'", 'blank': 'True'}), + 'bp_systolic_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'db_column': "'bp_systolic_value'", 'blank': 'True'}), + 'date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'encounter': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['indivo.Encounter']", 'null': 'True', 'blank': 'True'}), + 'fact_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['indivo.Fact']", 'unique': 'True', 'primary_key': 'True'}), + 'head_circ_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'head_circ_name_code_id'", 'blank': 'True'}), + 'head_circ_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'head_circ_name_code_sys'", 'blank': 'True'}), + 'head_circ_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'head_circ_name_code_title'", 'blank': 'True'}), + 'head_circ_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'head_circ_name_prov_sc'", 'blank': 'True'}), + 'head_circ_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'head_circ_name_prov_title'", 'blank': 'True'}), + 'head_circ_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'head_circ_name_prov_tf_id'", 'blank': 'True'}), + 'head_circ_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'head_circ_name_prov_tf_sys'", 'blank': 'True'}), + 'head_circ_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'head_circ_name_prov_tf_title'", 'blank': 'True'}), + 'head_circ_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'head_circ_name_title'", 'blank': 'True'}), + 'head_circ_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'head_circ_unit'", 'blank': 'True'}), + 'head_circ_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'db_column': "'head_circ_value'", 'blank': 'True'}), + 'heart_rate_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'heart_rate_name_code_id'", 'blank': 'True'}), + 'heart_rate_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'heart_rate_name_code_sys'", 'blank': 'True'}), + 'heart_rate_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'heart_rate_name_code_title'", 'blank': 'True'}), + 'heart_rate_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'heart_rate_name_prov_sc'", 'blank': 'True'}), + 'heart_rate_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'heart_rate_name_prov_title'", 'blank': 'True'}), + 'heart_rate_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'heart_rate_name_prov_tf_id'", 'blank': 'True'}), + 'heart_rate_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'heart_rate_name_prov_tf_sys'", 'blank': 'True'}), + 'heart_rate_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'heart_rate_name_prov_tf_title'", 'blank': 'True'}), + 'heart_rate_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'heart_rate_name_title'", 'blank': 'True'}), + 'heart_rate_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'heart_rate_unit'", 'blank': 'True'}), + 'heart_rate_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'db_column': "'heart_rate_value'", 'blank': 'True'}), + 'height_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'height_name_code_id'", 'blank': 'True'}), + 'height_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'height_name_code_sys'", 'blank': 'True'}), + 'height_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'height_name_code_title'", 'blank': 'True'}), + 'height_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'height_name_prov_sc'", 'blank': 'True'}), + 'height_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'height_name_prov_title'", 'blank': 'True'}), + 'height_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'height_name_prov_tf_id'", 'blank': 'True'}), + 'height_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'height_name_prov_tf_sys'", 'blank': 'True'}), + 'height_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'height_name_prov_tf_title'", 'blank': 'True'}), + 'height_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'height_name_title'", 'blank': 'True'}), + 'height_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'height_unit'", 'blank': 'True'}), + 'height_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'db_column': "'height_value'", 'blank': 'True'}), + 'oxygen_saturation_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'oxygen_saturation_name_code_id'", 'blank': 'True'}), + 'oxygen_saturation_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'oxygen_saturation_name_code_sys'", 'blank': 'True'}), + 'oxygen_saturation_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'oxygen_saturation_name_code_title'", 'blank': 'True'}), + 'oxygen_saturation_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'oxygen_saturation_name_prov_sc'", 'blank': 'True'}), + 'oxygen_saturation_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'oxygen_saturation_name_prov_title'", 'blank': 'True'}), + 'oxygen_saturation_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'oxygen_saturation_name_prov_tf_id'", 'blank': 'True'}), + 'oxygen_saturation_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'oxygen_saturation_name_prov_tf_sys'", 'blank': 'True'}), + 'oxygen_saturation_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'oxygen_saturation_name_prov_tf_title'", 'blank': 'True'}), + 'oxygen_saturation_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'oxygen_saturation_name_title'", 'blank': 'True'}), + 'oxygen_saturation_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'oxygen_saturation_unit'", 'blank': 'True'}), + 'oxygen_saturation_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'db_column': "'oxygen_saturation_value'", 'blank': 'True'}), + 'respiratory_rate_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'respiratory_rate_name_code_id'", 'blank': 'True'}), + 'respiratory_rate_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'respiratory_rate_name_code_sys'", 'blank': 'True'}), + 'respiratory_rate_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'respiratory_rate_name_code_title'", 'blank': 'True'}), + 'respiratory_rate_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'respiratory_rate_name_prov_sc'", 'blank': 'True'}), + 'respiratory_rate_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'respiratory_rate_name_prov_title'", 'blank': 'True'}), + 'respiratory_rate_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'respiratory_rate_name_prov_tf_id'", 'blank': 'True'}), + 'respiratory_rate_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'respiratory_rate_name_prov_tf_sys'", 'blank': 'True'}), + 'respiratory_rate_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'respiratory_rate_name_prov_tf_title'", 'blank': 'True'}), + 'respiratory_rate_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'respiratory_rate_name_title'", 'blank': 'True'}), + 'respiratory_rate_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'respiratory_rate_unit'", 'blank': 'True'}), + 'respiratory_rate_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'db_column': "'respiratory_rate_value'", 'blank': 'True'}), + 'temperature_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'temperature_name_code_id'", 'blank': 'True'}), + 'temperature_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'temperature_name_code_sys'", 'blank': 'True'}), + 'temperature_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'temperature_name_code_title'", 'blank': 'True'}), + 'temperature_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'temperature_name_prov_sc'", 'blank': 'True'}), + 'temperature_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'temperature_name_prov_title'", 'blank': 'True'}), + 'temperature_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'temperature_name_prov_tf_id'", 'blank': 'True'}), + 'temperature_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'temperature_name_prov_tf_sys'", 'blank': 'True'}), + 'temperature_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'temperature_name_prov_tf_title'", 'blank': 'True'}), + 'temperature_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'temperature_name_title'", 'blank': 'True'}), + 'temperature_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'temperature_unit'", 'blank': 'True'}), + 'temperature_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'db_column': "'temperature_value'", 'blank': 'True'}), + 'weight_name_code_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'weight_name_code_id'", 'blank': 'True'}), + 'weight_name_code_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'weight_name_code_sys'", 'blank': 'True'}), + 'weight_name_code_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'weight_name_code_title'", 'blank': 'True'}), + 'weight_name_provenance_source_code': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'weight_name_prov_sc'", 'blank': 'True'}), + 'weight_name_provenance_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'weight_name_prov_title'", 'blank': 'True'}), + 'weight_name_provenance_translation_fidelity_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'weight_name_prov_tf_id'", 'blank': 'True'}), + 'weight_name_provenance_translation_fidelity_system': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'weight_name_prov_tf_sys'", 'blank': 'True'}), + 'weight_name_provenance_translation_fidelity_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'weight_name_prov_tf_title'", 'blank': 'True'}), + 'weight_name_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'weight_name_title'", 'blank': 'True'}), + 'weight_unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'db_column': "'weight_unit'", 'blank': 'True'}), + 'weight_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'db_column': "'weight_value'", 'blank': 'True'}) + } + } + + complete_apps = ['indivo'] diff --git a/indivo/models/base.py b/indivo/models/base.py index 80fc671f..1f0c1414 100644 --- a/indivo/models/base.py +++ b/indivo/models/base.py @@ -248,9 +248,11 @@ def replace_field(fields_dict, field_name, field): # build the new fields to replace the old field with for suffix, new_field_params in field.__class__.replacements.iteritems(): - new_name = "%s%s"%(field_name, suffix) + new_name = "%s_%s"%(field_name, suffix) new_field_class, new_field_kwargs = new_field_params new_field = new_field_class(**new_field_kwargs) + # use db_column name if specified, otherwise default to suffix + new_field.db_column = "%s_%s" % ((field.db_column or field_name), (new_field.db_column or suffix)) new_field.blank = True new_fields_dict[new_name] = new_field diff --git a/indivo/schemas/data/core/procedure/procedure.xml b/indivo/schemas/data/core/procedure/procedure.xml deleted file mode 100644 index 2bbf3309..00000000 --- a/indivo/schemas/data/core/procedure/procedure.xml +++ /dev/null @@ -1,8 +0,0 @@ - - 2009-05-16T12:00:00 - Appendectomy - - Kenneth Mandl - Children's Hospital Boston - - diff --git a/indivo/schemas/data/core/procedure/schema.xsd b/indivo/schemas/data/core/procedure/schema.xsd deleted file mode 100644 index 5445c3f9..00000000 --- a/indivo/schemas/data/core/procedure/schema.xsd +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/indivo/schemas/data/core/procedure/transform.xsl b/indivo/schemas/data/core/procedure/transform.xsl deleted file mode 100644 index ba22d439..00000000 --- a/indivo/schemas/data/core/procedure/transform.xsl +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/indivo/tests/api/carenets_tests.py b/indivo/tests/api/carenets_tests.py index 19097225..2b083d09 100644 --- a/indivo/tests/api/carenets_tests.py +++ b/indivo/tests/api/carenets_tests.py @@ -192,7 +192,7 @@ def test_get_carenet_measurements(self): def test_get_carenet_procedures(self): c_id = self.shared_carenet.id - url = '/carenets/%s/reports/minimal/procedures/'%(c_id) + url = '/carenets/%s/reports/procedure/'%(c_id) bad_methods = ['put', 'post', 'delete'] self.check_unsupported_http_methods(bad_methods, url) diff --git a/indivo/tests/api/records_tests.py b/indivo/tests/api/records_tests.py index 4424cc51..689aa408 100644 --- a/indivo/tests/api/records_tests.py +++ b/indivo/tests/api/records_tests.py @@ -751,7 +751,7 @@ def test_get_record_measurements(self): def test_get_record_procedures(self): record_id = self.record.id - url = '/records/%s/reports/minimal/procedures/'%(record_id) + url = '/records/%s/reports/procedure/'%(record_id) response = self.client.get(url) self.assertEquals(response.status_code, 200) # ADD REPORTS diff --git a/indivo/tests/api/reporting_tests.py b/indivo/tests/api/reporting_tests.py index 6d843467..948a952d 100644 --- a/indivo/tests/api/reporting_tests.py +++ b/indivo/tests/api/reporting_tests.py @@ -48,18 +48,18 @@ def test_get_simple_clinical_notes(self): def test_get_procedures(self): record_id = self.record.id - url = '/records/%s/reports/minimal/procedures/?group_by=procedure_name&aggregate_by=count*procedure_name&date_range=date_performed*2005-03-10T00:00:00Z*'%(record_id) + url = '/records/%s/reports/procedure/?group_by=name_code_title&aggregate_by=count*name_code_title&date_range=date*2005-03-10T00:00:00Z*'%(record_id) bad_methods = ['put', 'post', 'delete'] self.check_unsupported_http_methods(bad_methods, url) response = self.client.get(url) self.assertEquals(response.status_code, 200) - url2 = '/records/%s/reports/minimal/procedures/?procedure_name=Appendectomy&date_group=date_performed*month&aggregate_by=count*procedure_name&order_by=-date_performed'%(record_id) + url2 = '/records/%s/reports/procedure/?name_code_title=Appendectomy&date_group=date*month&aggregate_by=count*name_code_title&order_by=-date'%(record_id) response = self.client.get(url2) self.assertEquals(response.status_code, 200) - url3 = '/records/%s/reports/minimal/procedures/?order_by=date_performed'%(record_id) + url3 = '/records/%s/reports/procedure/?order_by=date'%(record_id) response = self.client.get(url3) self.assertEquals(response.status_code, 200) @@ -152,7 +152,7 @@ def test_get_generic_labs(self): # check to make sure Model name is correct, and that it has 37 fields first_lab = response_json[0] self.assertEquals(first_lab['__modelname__'], 'LabResult') - self.assertEquals(len(first_lab), 37) + self.assertEquals(len(first_lab), 43) def test_generic_query_api(self): record_id = self.record.id @@ -208,13 +208,13 @@ def test_generic_query_api(self): self.assertEqual(response_json[0]['date'], '2009-05-16T12:00:00Z') # string {field} - url = '/records/%s/reports/vitalsigns/?weight_name_title=Body weight'%(record_id) + url = '/records/%s/reports/vitalsigns/?weight_name_code_title=Body weight'%(record_id) response = self.client.get(url) self.assertEquals(response.status_code, 200) response_json = json.loads(response.content) self.assertEqual(len(response_json), 2) - self.assertEqual(response_json[0]['weight_name_title'], 'Body weight') - self.assertEqual(response_json[1]['weight_name_title'], 'Body weight') + self.assertEqual(response_json[0]['weight_name_code_title'], 'Body weight') + self.assertEqual(response_json[1]['weight_name_code_title'], 'Body weight') # number {field} url = '/records/%s/reports/vitalsigns/?weight_value=70.8'%(record_id) @@ -272,3 +272,18 @@ def test_get_smart_allergies(self): response = self.client.get('/records/%s/allergies/%s' % (self.record.id, allergy_id)) self.assertEquals(response.status_code, 200) + + def test_get_smart_procedures(self): + response = self.client.get('/records/%s/procedures/'%(self.record.id)) + self.assertEquals(response.status_code, 200) + g = Graph() + g.parse(data=response.content, format="application/rdf+xml") + procedures = [l for l in g.subjects(None,SMART["Procedure"])] + self.assertEqual(len(procedures), 2) + + # retrieve a single procedure + procedure_id = procedures[0].split('/')[-1] + + response = self.client.get('/records/%s/procedures/%s' % (self.record.id, procedure_id)) + self.assertEquals(response.status_code, 200) + \ No newline at end of file diff --git a/indivo/tests/data/reports/allergy.py b/indivo/tests/data/reports/allergy.py index 099b3215..597724a9 100644 --- a/indivo/tests/data/reports/allergy.py +++ b/indivo/tests/data/reports/allergy.py @@ -3,20 +3,20 @@ _TEST_ALLERGIES_INVALID = [ # an allergy with the wrong schema, should trigger a validation error """ - + - Anaphylaxis - http://purl.bioontology.org/ontology/SNOMEDCT/ - 39579001 - Drug allergy - http://purl.bioontology.org/ontology/SNOMEDCT/ - 416098002 - Sulfonamide Antibacterial - http://purl.bioontology.org/ontology/NDFRT/ - N0000175503 - Severe - http://purl.bioontology.org/ontology/SNOMEDCT/ - 24484000 + Anaphylaxis + http://purl.bioontology.org/ontology/SNOMEDCT/ + 39579001 + Drug allergy + http://purl.bioontology.org/ontology/SNOMEDCT/ + 416098002 + Sulfonamide Antibacterial + http://purl.bioontology.org/ontology/NDFRT/ + N0000175503 + Severe + http://purl.bioontology.org/ontology/SNOMEDCT/ + 24484000 THIS SHOULDN'T BE THERE @@ -25,20 +25,20 @@ _TEST_ALLERGIES = [ """ - + - Anaphylaxis - http://purl.bioontology.org/ontology/SNOMEDCT/ - 39579001 - Drug allergy - http://purl.bioontology.org/ontology/SNOMEDCT/ - 416098002 - Sulfonamide Antibacterial - http://purl.bioontology.org/ontology/NDFRT/ - N0000175503 - Severe - http://purl.bioontology.org/ontology/SNOMEDCT/ - 24484000 + Anaphylaxis + http://purl.bioontology.org/ontology/SNOMEDCT/ + 39579001 + Drug allergy + http://purl.bioontology.org/ontology/SNOMEDCT/ + 416098002 + Sulfonamide Antibacterial + http://purl.bioontology.org/ontology/NDFRT/ + N0000175503 + Severe + http://purl.bioontology.org/ontology/SNOMEDCT/ + 24484000 """, diff --git a/indivo/tests/data/reports/immunization.py b/indivo/tests/data/reports/immunization.py index 43f27a7c..3cad307e 100644 --- a/indivo/tests/data/reports/immunization.py +++ b/indivo/tests/data/reports/immunization.py @@ -5,18 +5,18 @@ 2009-05-16T12:00:00Z - Not Administered - http://smartplatforms.org/terms/codes/ImmunizationAdministrationStatus# - notAdministered - TYPHOID - http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=vg# - TYPHOID - typhoid, oral - http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=cvx# - 25 - Allergy to vaccine/vaccine components, or allergy to eggs - http://smartplatforms.org/terms/codes/ImmunizationRefusalReason# - allergy + Not Administered + http://smartplatforms.org/terms/codes/ImmunizationAdministrationStatus# + notAdministered + TYPHOID + http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=vg# + TYPHOID + typhoid, oral + http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=cvx# + 25 + Allergy to vaccine/vaccine components, or allergy to eggs + http://smartplatforms.org/terms/codes/ImmunizationRefusalReason# + allergy """, diff --git a/indivo/tests/data/reports/lab.py b/indivo/tests/data/reports/lab.py index d74b5795..91008c89 100644 --- a/indivo/tests/data/reports/lab.py +++ b/indivo/tests/data/reports/lab.py @@ -2,21 +2,23 @@ _TEST_LABS = [ """ - + - Normal - http://smartplatforms.org/terms/codes/LabResultInterpretation# - normal + 2009-05-16T12:00:00Z + + Normal + http://smartplatforms.org/terms/codes/LabResultInterpretation# + normal AC09205823577 - Serum Sodium - http://purl.bioontology.org/ontology/LNC/ - 2951-2 + Serum Sodium + http://purl.bioontology.org/ontology/LNC/ + 2951-2 - Final results: complete and verified - http://smartplatforms.org/terms/codes/LabStatus# - final + Final results: complete and verified + http://smartplatforms.org/terms/codes/LabStatus# + final Blood sample appears to have hemolyzed @@ -32,20 +34,6 @@ 140 mEq/L - - 2010-12-27T17:00:00Z - - City Lab - USA - Springfield - 11111 - MA - 20 Elm St - - Finnialispi - Tad - - Lab Specialist """, diff --git a/indivo/tests/data/reports/procedure.py b/indivo/tests/data/reports/procedure.py index b3cbdfac..4f161e87 100644 --- a/indivo/tests/data/reports/procedure.py +++ b/indivo/tests/data/reports/procedure.py @@ -2,25 +2,49 @@ _TEST_PROCEDURES = [ """ - - 2009-05-16T12:00:00Z - Appendectomy - - Kenneth Mandl - Children's Hospital Boston - - + + + 2011-02-15T12:00:00Z + Went great! + Appendectomy + http://purl.bioontology.org/ontology/SNOMEDCT/ + 80146002 + Complete + http://purl.bioontology.org/ontology/SNOMEDCT/ + 385658003 + 325555555 + 5235235 + joshua.mandel@fake.emailserver.com + Josuha + Mandel + w + 1-235-947-3452 + True + + """, - """ - - 2009-06-16T12:00:00Z - Appendectomy - - Kenneth Mandl - Children's Hospital Boston - - +""" + + + 2011-05-15T12:00:00Z + Went OK + Appendectomy + http://purl.bioontology.org/ontology/SNOMEDCT/ + 80146002 + Complete + http://purl.bioontology.org/ontology/SNOMEDCT/ + 385658003 + 325555555 + 5235235 + joshua.mandel@fake.emailserver.com + Josuha + Mandel + w + 1-235-947-3452 + True + + """, ] diff --git a/indivo/tests/data/reports/vital.py b/indivo/tests/data/reports/vital.py index a435453e..adef5b06 100644 --- a/indivo/tests/data/reports/vital.py +++ b/indivo/tests/data/reports/vital.py @@ -22,76 +22,81 @@ w 1-235-947-3452 true - Ambulatory encounter - http://smartplatforms.org/terms/codes/EncounterType# - ambulatory + Ambulatory encounter + http://smartplatforms.org/terms/codes/EncounterType# + ambulatory - Sitting - 33586001 - http://purl.bioontology.org/ontology/SNOMEDCT/ - Right arm - 368209003 - http://purl.bioontology.org/ontology/SNOMEDCT/ - Auscultation - auscultation - http://smartplatforms.org/terms/codes/BloodPressureMethod# + Sitting + 33586001 + http://purl.bioontology.org/ontology/SNOMEDCT/ + Right arm + 368209003 + http://purl.bioontology.org/ontology/SNOMEDCT/ + Auscultation + auscultation + http://smartplatforms.org/terms/codes/BloodPressureMethod# mm[Hg] 82 - Intravascular diastolic - 8462-4 - http://purl.bioontology.org/ontology/LNC/ + Intravascular diastolic + 8462-4 + http://purl.bioontology.org/ontology/LNC/ mm[Hg] 132 - Intravascular systolic - 8480-6 - http://purl.bioontology.org/ontology/LNC/ + Intravascular systolic + 8480-6 + http://purl.bioontology.org/ontology/LNC/ kg/m2 21.8 - Body mass index - http://purl.bioontology.org/ontology/LNC/ - 39156-5 + Body mass index + http://purl.bioontology.org/ontology/LNC/ + 39156-5 {beats}/min 70 - Heart rate - http://purl.bioontology.org/ontology/LNC/ - 8867-4 + Heart rate + http://purl.bioontology.org/ontology/LNC/ + 8867-4 m 1.8 - Body height - http://purl.bioontology.org/ontology/LNC/ - 8302-2 + Body height + http://purl.bioontology.org/ontology/LNC/ + 8302-2 %{HemoglobinSaturation} 99 - Oxygen saturation - http://purl.bioontology.org/ontology/LNC/ - 2710-2 + Oxygen saturation + http://purl.bioontology.org/ontology/LNC/ + 2710-2 {breaths}/min 16 - Respiration rate - http://purl.bioontology.org/ontology/LNC/ - 9279-1 + Respiration rate + http://purl.bioontology.org/ontology/LNC/ + 9279-1 Cel 37 - Body temperature - http://purl.bioontology.org/ontology/LNC/ - 8310-5 + Body temperature + http://purl.bioontology.org/ontology/LNC/ + 8310-5 kg - 70.8 - Body weight - http://purl.bioontology.org/ontology/LNC/ - 3141-9 + 80.8 + Body weight + http://purl.bioontology.org/ontology/LNC/ + 3141-9 + cm + 70 + Head circumference + http://purl.bioontology.org/ontology/LNC/ + 8287-5 -""", + """, """ 2010-05-16T12:00:00Z - 2010-05-16T12:00:00Z - 2010-05-16T16:00:00Z + 2009-05-16T12:00:00Z + 2009-05-16T16:00:00Z Wonder Hospital Australia WonderCity @@ -105,65 +110,70 @@ w 1-235-947-3452 true - Ambulatory encounter - http://smartplatforms.org/terms/codes/EncounterType# - ambulatory + Ambulatory encounter + http://smartplatforms.org/terms/codes/EncounterType# + ambulatory - Sitting - 33586001 - http://purl.bioontology.org/ontology/SNOMEDCT/ - Right arm - 368209003 - http://purl.bioontology.org/ontology/SNOMEDCT/ - Auscultation - auscultation - http://smartplatforms.org/terms/codes/BloodPressureMethod# + Sitting + 33586001 + http://purl.bioontology.org/ontology/SNOMEDCT/ + Right arm + 368209003 + http://purl.bioontology.org/ontology/SNOMEDCT/ + Auscultation + auscultation + http://smartplatforms.org/terms/codes/BloodPressureMethod# mm[Hg] - 82 - Intravascular diastolic - 8462-4 - http://purl.bioontology.org/ontology/LNC/ + 87 + Intravascular diastolic + 8462-4 + http://purl.bioontology.org/ontology/LNC/ mm[Hg] - 132 - Intravascular systolic - 8480-6 - http://purl.bioontology.org/ontology/LNC/ + 139 + Intravascular systolic + 8480-6 + http://purl.bioontology.org/ontology/LNC/ kg/m2 21.8 - Body mass index - http://purl.bioontology.org/ontology/LNC/ - 39156-5 + Body mass index + http://purl.bioontology.org/ontology/LNC/ + 39156-5 {beats}/min - 70 - Heart rate - http://purl.bioontology.org/ontology/LNC/ - 8867-4 + 75 + Heart rate + http://purl.bioontology.org/ontology/LNC/ + 8867-4 m 1.8 - Body height - http://purl.bioontology.org/ontology/LNC/ - 8302-2 + Body height + http://purl.bioontology.org/ontology/LNC/ + 8302-2 %{HemoglobinSaturation} 99 - Oxygen saturation - http://purl.bioontology.org/ontology/LNC/ - 2710-2 + Oxygen saturation + http://purl.bioontology.org/ontology/LNC/ + 2710-2 {breaths}/min 16 - Respiration rate - http://purl.bioontology.org/ontology/LNC/ - 9279-1 + Respiration rate + http://purl.bioontology.org/ontology/LNC/ + 9279-1 Cel - 37 - Body temperature - http://purl.bioontology.org/ontology/LNC/ - 8310-5 + 36 + Body temperature + http://purl.bioontology.org/ontology/LNC/ + 8310-5 kg - 80.8 - Body weight - http://purl.bioontology.org/ontology/LNC/ - 3141-9 + 70.8 + Body weight + http://purl.bioontology.org/ontology/LNC/ + 3141-9 + cm + 70 + Head circumference + http://purl.bioontology.org/ontology/LNC/ + 8287-5 """, diff --git a/indivo/tests/integration/pluggable_schemas.py b/indivo/tests/integration/pluggable_schemas.py index 12d45181..23e46a13 100644 --- a/indivo/tests/integration/pluggable_schemas.py +++ b/indivo/tests/integration/pluggable_schemas.py @@ -159,7 +159,7 @@ def test_core_model_xml(self): self.assertEqual(len(labs), 1) lab = labs[0] - self.assertEqual(len(lab.findall('Field')), 35) + self.assertEqual(len(lab.findall('Field')), 41) self.assertEqual(lab.get('name'), 'LabResult') def test_sdmx_schema(self): diff --git a/indivo/tests/integration/test_modules/document_processing.py b/indivo/tests/integration/test_modules/document_processing.py index cd652017..a96c679a 100644 --- a/indivo/tests/integration/test_modules/document_processing.py +++ b/indivo/tests/integration/test_modules/document_processing.py @@ -56,7 +56,7 @@ def test_document_processing(IndivoClient): reports = [ chrome_client.read_equipment(), - chrome_client.read_procedures(), +# chrome_client.read_procedures(), #chrome_client.read_measurements(lab_code='HBA1C', parameters={'limit':1}) chrome_client.read_measurements(lab_code='HBA1C'), chrome_client.read_ccr_experimental(), diff --git a/indivo/tests/integration/test_modules/security.py b/indivo/tests/integration/test_modules/security.py index 4e87b947..dfe817f6 100644 --- a/indivo/tests/integration/test_modules/security.py +++ b/indivo/tests/integration/test_modules/security.py @@ -61,7 +61,7 @@ def test_client_expect_no_access(client, record_id, document_id, run_special_adm assert_403(client.set_document_status(record_id=record_id, document_id=document_id, data='reason=void1&status=void')) assert_403(client.read_document_status_history(record_id=record_id, document_id=document_id)) - reports = ['read_equipment', 'read_procedures', + reports = ['read_equipment', ['read_measurements', {'lab_code':'HBA1C'}]] for report in reports: extra_params = {} diff --git a/indivo/tests/schemas/core/procedure/procedure.xml b/indivo/tests/schemas/core/procedure/procedure.xml deleted file mode 100644 index 2bbf3309..00000000 --- a/indivo/tests/schemas/core/procedure/procedure.xml +++ /dev/null @@ -1,8 +0,0 @@ - - 2009-05-16T12:00:00 - Appendectomy - - Kenneth Mandl - Children's Hospital Boston - - diff --git a/indivo/tests/schemas/core/procedure/schema.xsd b/indivo/tests/schemas/core/procedure/schema.xsd deleted file mode 100644 index 5445c3f9..00000000 --- a/indivo/tests/schemas/core/procedure/schema.xsd +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/indivo/tests/schemas/core/procedure/transform.xsl b/indivo/tests/schemas/core/procedure/transform.xsl deleted file mode 100644 index ba22d439..00000000 --- a/indivo/tests/schemas/core/procedure/transform.xsl +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/indivo/tests/unit/lib/schema_loader.py b/indivo/tests/unit/lib/schema_loader.py index e2349065..66ff0aa8 100644 --- a/indivo/tests/unit/lib/schema_loader.py +++ b/indivo/tests/unit/lib/schema_loader.py @@ -9,7 +9,6 @@ VALID_CORE_SCHEMAS = { 'equipment': NS+'Equipment', - 'procedure': NS+'Procedure', 'simplenote': NS+'SimpleClinicalNote', } diff --git a/indivo/tests/unit/lib/simpledatamodel.py b/indivo/tests/unit/lib/simpledatamodel.py index fc74e80a..e125942f 100644 --- a/indivo/tests/unit/lib/simpledatamodel.py +++ b/indivo/tests/unit/lib/simpledatamodel.py @@ -84,9 +84,15 @@ def test_get_output(self): 'date_filled': models.DateField, 'supply_days': models.FloatField, 'filled_at_name': models.CharField, - 'code_identifier': models.CharField, # CodedValues should be expanded + 'code_code_identifier': models.CharField, # CodedValues should be expanded + 'code_code_title': models.CharField, + 'code_code_system': models.CharField, 'code_title': models.CharField, - 'code_system': models.CharField, + 'code_provenance_source_code': models.CharField, + 'code_provenance_title': models.CharField, + 'code_provenance_translation_fidelity_identifier': models.CharField, + 'code_provenance_translation_fidelity_system': models.CharField, + 'code_provenance_translation_fidelity_title': models.CharField, 'quantity_value': models.CharField, # ValueAndUnit fields should be expanded 'quantity_unit': models.CharField, 'pharmacy_ncpdpid': models.CharField, # Pharmacy fields should be expanded diff --git a/indivo/tests/unit/models/document.py b/indivo/tests/unit/models/document.py index d84602c5..b2a4d90a 100644 --- a/indivo/tests/unit/models/document.py +++ b/indivo/tests/unit/models/document.py @@ -211,7 +211,7 @@ def test_replace(self): try: self.r_doc1.replace(invalid_xml, new_mimetype) - except ValueError: + except ValueError as e: self.fail('Could not add invalid document even with validation off') # Set the doc to replaced, make sure replacing it fails diff --git a/indivo/tests/unit/models/fact.py b/indivo/tests/unit/models/fact.py index 9f8908cc..7da42447 100644 --- a/indivo/tests/unit/models/fact.py +++ b/indivo/tests/unit/models/fact.py @@ -45,13 +45,19 @@ def test_metaclass(self): # generate a subclass of fact FactSubclass = type("FactSubclass", (Fact,), fact_subclass_attrs) - # Since 'coded' was a CodedValueField, we should see three new fields on the subclass + # Since 'coded' was a CodedValueField, we should see nine new fields on the subclass valid_fields = { 'fact_ptr': models.OneToOneField, # pointer to the parent class 'not_coded': models.IntegerField, # original integer field, preserved - 'coded_identifier': models.CharField, # New fields substituted for the DummyField + 'coded_code_identifier': models.CharField, # New fields substituted for the DummyField + 'coded_code_system': models.CharField, + 'coded_code_title': models.CharField, 'coded_title': models.CharField, - 'coded_system': models.CharField, + 'coded_provenance_source_code': models.CharField, + 'coded_provenance_title': models.CharField, + 'coded_provenance_translation_fidelity_identifier': models.CharField, + 'coded_provenance_translation_fidelity_system': models.CharField, + 'coded_provenance_translation_fidelity_title': models.CharField, } self.assertEqual(len(valid_fields.keys()), len(FactSubclass._meta.local_fields)) for field in FactSubclass._meta.local_fields: diff --git a/indivo/urls/carenet.py b/indivo/urls/carenet.py index f6e81fdd..95432b46 100644 --- a/indivo/urls/carenet.py +++ b/indivo/urls/carenet.py @@ -36,8 +36,6 @@ MethodDispatcher({ 'GET' : carenet_app_permissions })), # Reporting Calls - (r'^/reports/minimal/procedures/$', - MethodDispatcher({'GET':carenet_procedure_list})), (r'^/reports/minimal/simple-clinical-notes/$', MethodDispatcher({'GET':carenet_simple_clinical_notes_list})), (r'^/reports/minimal/equipment/$', diff --git a/indivo/urls/record_reports.py b/indivo/urls/record_reports.py index 1fe3d14c..157f9d7e 100644 --- a/indivo/urls/record_reports.py +++ b/indivo/urls/record_reports.py @@ -6,8 +6,6 @@ urlpatterns = patterns('', (r'^minimal/measurements/(?P[^/]+)/$', MethodDispatcher({'GET':measurement_list})), - (r'^minimal/procedures/$', - MethodDispatcher({'GET':procedure_list})), (r'^minimal/equipment/$', MethodDispatcher({'GET':equipment_list})), (r'^minimal/simple-clinical-notes/$', diff --git a/indivo/views/pha.py b/indivo/views/pha.py index 511f66fd..2d636a35 100644 --- a/indivo/views/pha.py +++ b/indivo/views/pha.py @@ -158,8 +158,8 @@ def request_token(request): # we already have the oauth_request in context, so we don't get it again from indivo.accesscontrol.oauth_servers import OAUTH_SERVER request_token = OAUTH_SERVER.generate_request_token(request.oauth_request, - record_id = request.POST.get('indivo_record_id', None), - carenet_id = request.POST.get('indivo_carenet_id', None)) + record_id = request.REQUEST.get('indivo_record_id', None), + carenet_id = request.REQUEST.get('indivo_carenet_id', None)) return HttpResponse(request_token.to_string(), mimetype='text/plain') except oauth.OAuthError, e: # an exception can be raised if there is a bad signature (or no signature) in the request diff --git a/indivo/views/reports/smart.py b/indivo/views/reports/smart.py index 8b4a9a75..16525942 100644 --- a/indivo/views/reports/smart.py +++ b/indivo/views/reports/smart.py @@ -22,7 +22,8 @@ 'immunizations': 'Immunization', 'lab_results': 'LabResult', 'medications': 'Medication', - 'vital_signs': 'VitalSigns', + 'vital_sign_sets': 'VitalSigns', + 'procedures': 'Procedure', } def get_default_query_args(): diff --git a/indivo/views/smart_container.py b/indivo/views/smart_container.py index 4fb10689..4070c1f8 100644 --- a/indivo/views/smart_container.py +++ b/indivo/views/smart_container.py @@ -94,7 +94,7 @@ def smart_capabilities(request): "PUT" ] }, - "http://smartplatforms.org/terms#VitalSigns": { + "http://smartplatforms.org/terms#VitalSignSet": { "methods": [ "GET" ]