Skip to content

Commit

Permalink
inital changes for SMART v0.5
Browse files Browse the repository at this point in the history
- Update CodedValue
- Move Procedure to SMART data model, fixes chb#24
- Update LabResult, fixes chb#28
- Update Vital Signs, fixes chb#29
- Update Allergy, fixes chb#30
-
  • Loading branch information
Travers Franckle committed Dec 31, 2012
1 parent 9826c67 commit 0817432
Show file tree
Hide file tree
Showing 68 changed files with 3,266 additions and 962 deletions.
29 changes: 15 additions & 14 deletions indivo/data_models/core/allergy/example.py
Original file line number Diff line number Diff line change
@@ -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/",
)
29 changes: 15 additions & 14 deletions indivo/data_models/core/allergy/example.sdmj
Original file line number Diff line number Diff line change
@@ -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"
}]
33 changes: 17 additions & 16 deletions indivo/data_models/core/allergy/example.sdmx
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<Models>
<Models xmlns="http://indivo.org/vocab/xml/documents#">
<Model name="Allergy">
<Field name="allergic_reaction_title">Anaphylaxis</Field>
<Field name="allergic_reaction_system">http://purl.bioontology.org/ontology/SNOMEDCT/</Field>
<Field name="allergic_reaction_identifier">39579001</Field>
<Field name="category_title">Drug allergy</Field>
<Field name="category_system">http://purl.bioontology.org/ontology/SNOMEDCT/</Field>
<Field name="category_identifier">416098002</Field>
<Field name="drug_class_allergen_title">Sulfonamide Antibacterial</Field>
<Field name="drug_class_allergen_system">http://purl.bioontology.org/ontology/NDFRT/</Field>
<Field name="drug_class_allergen_identifier">N0000175503</Field>
<Field name="severity_title">Severe</Field>
<Field name="severity_system">http://purl.bioontology.org/ontology/SNOMEDCT/</Field>
<Field name="severity_identifier">24484000</Field>
<Field name="allergic_reaction_code_title">Anaphylaxis</Field>
<Field name="allergic_reaction_code_system">http://purl.bioontology.org/ontology/SNOMEDCT/</Field>
<Field name="allergic_reaction_code_identifier">39579001</Field>
<Field name="category_code_title">Drug allergy</Field>
<Field name="category_code_system">http://purl.bioontology.org/ontology/SNOMEDCT/</Field>
<Field name="category_code_identifier">416098002</Field>
<Field name="drug_class_allergen_code_title">Sulfonamide Antibacterial</Field>
<Field name="drug_class_allergen_code_system">http://purl.bioontology.org/ontology/NDFRT/</Field>
<Field name="drug_class_allergen_code_identifier">N0000175503</Field>
<Field name="severity_code_title">Severe</Field>
<Field name="severity_code_system">http://purl.bioontology.org/ontology/SNOMEDCT/</Field>
<Field name="severity_code_identifier">24484000</Field>
</Model>
<Model name="AllergyExclusion">
<Field name="name_title">No known allergies</Field>
<Field name="name_identifier">160244002</Field>
<Field name = "name_system">http://purl.bioontology.org/ontology/SNOMEDCT/</Field>
<Field name="name_title">No known allergies</Field>
<Field name="name_code_title">No known allergies</Field>
<Field name="name_code_identifier">160244002</Field>
<Field name = "name_code_system">http://purl.bioontology.org/ontology/SNOMEDCT/</Field>
</Model>
</Models>
30 changes: 15 additions & 15 deletions indivo/data_models/core/allergy/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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()],
}
2 changes: 1 addition & 1 deletion indivo/data_models/core/allergy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion indivo/data_models/core/equipment/example.sdmx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Models>
<Models xmlns="http://indivo.org/vocab/xml/documents#">
<Model name="Equipment">
<Field name="date_started">2009-02-05</Field>
<Field name="date_stopped">2009-06-12</Field>
Expand Down
24 changes: 12 additions & 12 deletions indivo/data_models/core/immunization/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

24 changes: 12 additions & 12 deletions indivo/data_models/core/immunization/example.sdmj
Original file line number Diff line number Diff line change
@@ -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"
}

26 changes: 13 additions & 13 deletions indivo/data_models/core/immunization/example.sdmx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Models>
<Models xmlns="http://indivo.org/vocab/xml/documents#">
<Model name="Immunization">
<Field name="date">2009-05-16T12:00:00Z</Field>
<Field name="administration_status_title">Not Administered</Field>
<Field name="administration_status_system">http://smartplatforms.org/terms/codes/ImmunizationAdministrationStatus#</Field>
<Field name="administration_status_identifier">notAdministered</Field>
<Field name="product_class_title">TYPHOID</Field>
<Field name="product_class_system">http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=vg#</Field>
<Field name="product_class_identifier">TYPHOID</Field>
<Field name="product_name_title">typhoid, oral</Field>
<Field name="product_name_system">http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=cvx#</Field>
<Field name="product_name_identifier">25</Field>
<Field name="refusal_reason_title">Allergy to vaccine/vaccine components, or allergy to eggs</Field>
<Field name="refusal_reason_system">http://smartplatforms.org/terms/codes/ImmunizationRefusalReason#</Field>
<Field name="refusal_reason_identifier">allergy</Field>
<Field name="administration_status_code_title">Not Administered</Field>
<Field name="administration_status_code_system">http://smartplatforms.org/terms/codes/ImmunizationAdministrationStatus#</Field>
<Field name="administration_status_code_identifier">notAdministered</Field>
<Field name="product_class_code_title">TYPHOID</Field>
<Field name="product_class_code_system">http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=vg#</Field>
<Field name="product_class_code_identifier">TYPHOID</Field>
<Field name="product_name_code_title">typhoid, oral</Field>
<Field name="product_name_code_system">http://www2a.cdc.gov/nip/IIS/IISStandards/vaccines.asp?rpt=cvx#</Field>
<Field name="product_name_code_identifier">25</Field>
<Field name="refusal_reason_code_title">Allergy to vaccine/vaccine components, or allergy to eggs</Field>
<Field name="refusal_reason_code_system">http://smartplatforms.org/terms/codes/ImmunizationRefusalReason#</Field>
<Field name="refusal_reason_code_identifier">allergy</Field>
</Model>
</Models>

20 changes: 10 additions & 10 deletions indivo/data_models/core/immunization/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
}
36 changes: 12 additions & 24 deletions indivo/data_models/core/lab/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand All @@ -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"
)

30 changes: 9 additions & 21 deletions indivo/data_models/core/lab/example.sdmj
Original file line number Diff line number Diff line change
@@ -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",

Expand All @@ -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"
}

Loading

0 comments on commit 0817432

Please sign in to comment.